3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
29 #define DL_IMPORT(t) t
32 #define DL_EXPORT(t) t
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
44 #define Py_HUGE_VAL HUGE_VAL
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
218 #define CYTHON_RESTRICT
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
226 # define CYTHON_UNUSED
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
231 # define CYTHON_UNUSED
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
250 #ifndef _MSC_STDINT_H_
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
276 #define CYTHON_FALLTHROUGH
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
288 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
290 #ifndef CYTHON_INLINE
291 #if defined(__clang__)
292 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
294 #define CYTHON_INLINE inline
298 void __Pyx_call_destructor(
T& x) {
302 class __Pyx_FakeReference {
304 __Pyx_FakeReference() : ptr(NULL) { }
305 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
306 T *operator->() {
return ptr; }
307 T *operator&() {
return ptr; }
308 operator T&() {
return *ptr; }
309 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
310 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316 #define Py_OptimizeFlag 0
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324 #define __Pyx_DefaultClassType PyClass_Type
326 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
328 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
329 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
331 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
332 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
334 #define __Pyx_DefaultClassType PyType_Type
336 #ifndef Py_TPFLAGS_CHECKTYPES
337 #define Py_TPFLAGS_CHECKTYPES 0
339 #ifndef Py_TPFLAGS_HAVE_INDEX
340 #define Py_TPFLAGS_HAVE_INDEX 0
342 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
343 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
345 #ifndef Py_TPFLAGS_HAVE_FINALIZE
346 #define Py_TPFLAGS_HAVE_FINALIZE 0
348 #ifndef METH_STACKLESS
349 #define METH_STACKLESS 0
351 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
352 #ifndef METH_FASTCALL
353 #define METH_FASTCALL 0x80
355 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
356 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
357 Py_ssize_t nargs, PyObject *kwnames);
359 #define __Pyx_PyCFunctionFast _PyCFunctionFast
360 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
362 #if CYTHON_FAST_PYCCALL
363 #define __Pyx_PyFastCFunction_Check(func)\
364 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
366 #define __Pyx_PyFastCFunction_Check(func) 0
368 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
369 #define PyObject_Malloc(s) PyMem_Malloc(s)
370 #define PyObject_Free(p) PyMem_Free(p)
371 #define PyObject_Realloc(p) PyMem_Realloc(p)
373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
374 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
375 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
376 #define PyMem_RawFree(p) PyMem_Free(p)
378 #if CYTHON_COMPILING_IN_PYSTON
379 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
380 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
382 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
383 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
385 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
386 #define __Pyx_PyThreadState_Current PyThreadState_GET()
387 #elif PY_VERSION_HEX >= 0x03060000
388 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
389 #elif PY_VERSION_HEX >= 0x03000000
390 #define __Pyx_PyThreadState_Current PyThreadState_GET()
392 #define __Pyx_PyThreadState_Current _PyThreadState_Current
394 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
395 #include "pythread.h"
396 #define Py_tss_NEEDS_INIT 0
397 typedef int Py_tss_t;
398 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
399 *key = PyThread_create_key();
402 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
403 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
404 *key = Py_tss_NEEDS_INIT;
407 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
410 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
411 return *key != Py_tss_NEEDS_INIT;
413 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
414 PyThread_delete_key(*key);
415 *key = Py_tss_NEEDS_INIT;
417 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
418 return PyThread_set_key_value(*key, value);
420 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
421 return PyThread_get_key_value(*key);
424 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
425 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
427 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
429 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
430 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
431 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
433 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
434 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
437 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
439 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
441 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
442 #define CYTHON_PEP393_ENABLED 1
443 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
444 0 : _PyUnicode_Ready((PyObject *)(op)))
445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
446 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
448 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
449 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
450 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
452 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
453 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
455 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
458 #define CYTHON_PEP393_ENABLED 0
459 #define PyUnicode_1BYTE_KIND 1
460 #define PyUnicode_2BYTE_KIND 2
461 #define PyUnicode_4BYTE_KIND 4
462 #define __Pyx_PyUnicode_READY(op) (0)
463 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
464 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
465 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
466 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
467 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
468 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
469 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
470 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
472 #if CYTHON_COMPILING_IN_PYPY
473 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
474 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
476 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
477 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
478 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
480 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
481 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
483 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
484 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
486 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
487 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
489 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
490 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
491 #if PY_MAJOR_VERSION >= 3
492 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
494 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
496 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
497 #define PyObject_ASCII(o) PyObject_Repr(o)
499 #if PY_MAJOR_VERSION >= 3
500 #define PyBaseString_Type PyUnicode_Type
501 #define PyStringObject PyUnicodeObject
502 #define PyString_Type PyUnicode_Type
503 #define PyString_Check PyUnicode_Check
504 #define PyString_CheckExact PyUnicode_CheckExact
505 #ifndef PyObject_Unicode
506 #define PyObject_Unicode PyObject_Str
509 #if PY_MAJOR_VERSION >= 3
510 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
511 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
513 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
514 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
516 #ifndef PySet_CheckExact
517 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
519 #if PY_VERSION_HEX >= 0x030900A4
520 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
521 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
523 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
524 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
526 #if CYTHON_ASSUME_SAFE_MACROS
527 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
529 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
531 #if PY_MAJOR_VERSION >= 3
532 #define PyIntObject PyLongObject
533 #define PyInt_Type PyLong_Type
534 #define PyInt_Check(op) PyLong_Check(op)
535 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
536 #define PyInt_FromString PyLong_FromString
537 #define PyInt_FromUnicode PyLong_FromUnicode
538 #define PyInt_FromLong PyLong_FromLong
539 #define PyInt_FromSize_t PyLong_FromSize_t
540 #define PyInt_FromSsize_t PyLong_FromSsize_t
541 #define PyInt_AsLong PyLong_AsLong
542 #define PyInt_AS_LONG PyLong_AS_LONG
543 #define PyInt_AsSsize_t PyLong_AsSsize_t
544 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
545 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
546 #define PyNumber_Int PyNumber_Long
548 #if PY_MAJOR_VERSION >= 3
549 #define PyBoolObject PyLongObject
551 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
552 #ifndef PyUnicode_InternFromString
553 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
556 #if PY_VERSION_HEX < 0x030200A4
557 typedef long Py_hash_t;
558 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
559 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
561 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
562 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
564 #if PY_MAJOR_VERSION >= 3
565 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
567 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
569 #if CYTHON_USE_ASYNC_SLOTS
570 #if PY_VERSION_HEX >= 0x030500B1
571 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
572 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
574 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
577 #define __Pyx_PyType_AsAsync(obj) NULL
579 #ifndef __Pyx_PyAsyncMethodsStruct
584 } __Pyx_PyAsyncMethodsStruct;
587 #if defined(WIN32) || defined(MS_WINDOWS)
588 #define _USE_MATH_DEFINES
592 #define __PYX_NAN() ((float) NAN)
594 static CYTHON_INLINE
float __PYX_NAN() {
596 memset(&value, 0xFF,
sizeof(value));
600 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
601 #define __Pyx_truncl trunc
603 #define __Pyx_truncl truncl
606 #define __PYX_MARK_ERR_POS(f_index, lineno) \
607 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
608 #define __PYX_ERR(f_index, lineno, Ln_error) \
609 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
611 #ifndef __PYX_EXTERN_C
613 #define __PYX_EXTERN_C extern "C"
615 #define __PYX_EXTERN_C extern
619 #define __PYX_HAVE__BoundaryConditions
620 #define __PYX_HAVE_API__BoundaryConditions
624 #include "numpy/arrayobject.h"
625 #include "numpy/ufuncobject.h"
629 #include "pythread.h"
636 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
637 #define CYTHON_WITHOUT_ASSERTIONS
640 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
641 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
644 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
645 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
646 #define __PYX_DEFAULT_STRING_ENCODING ""
647 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
648 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
649 #define __Pyx_uchar_cast(c) ((unsigned char)c)
650 #define __Pyx_long_cast(x) ((long)x)
651 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
652 (sizeof(type) < sizeof(Py_ssize_t)) ||\
653 (sizeof(type) > sizeof(Py_ssize_t) &&\
654 likely(v < (type)PY_SSIZE_T_MAX ||\
655 v == (type)PY_SSIZE_T_MAX) &&\
656 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
657 v == (type)PY_SSIZE_T_MIN))) ||\
658 (sizeof(type) == sizeof(Py_ssize_t) &&\
659 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
660 v == (type)PY_SSIZE_T_MAX))) )
661 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
662 return (
size_t) i < (size_t) limit;
664 #if defined (__cplusplus) && __cplusplus >= 201103L
666 #define __Pyx_sst_abs(value) std::abs(value)
667 #elif SIZEOF_INT >= SIZEOF_SIZE_T
668 #define __Pyx_sst_abs(value) abs(value)
669 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
670 #define __Pyx_sst_abs(value) labs(value)
671 #elif defined (_MSC_VER)
672 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
673 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
674 #define __Pyx_sst_abs(value) llabs(value)
675 #elif defined (__GNUC__)
676 #define __Pyx_sst_abs(value) __builtin_llabs(value)
678 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
680 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
681 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
682 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
683 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
684 #define __Pyx_PyBytes_FromString PyBytes_FromString
685 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
686 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
687 #if PY_MAJOR_VERSION < 3
688 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
689 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
691 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
692 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
694 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
700 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
705 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
706 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
707 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
708 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
709 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
710 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
711 const Py_UNICODE *u_end =
u;
713 return (
size_t)(u_end -
u - 1);
715 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
716 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
717 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
718 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
719 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
720 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
721 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
722 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
723 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
724 #define __Pyx_PySequence_Tuple(obj)\
725 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
726 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
727 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
728 #if CYTHON_ASSUME_SAFE_MACROS
729 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
731 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
733 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
734 #if PY_MAJOR_VERSION >= 3
735 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
737 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
739 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
740 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
741 static int __Pyx_sys_getdefaultencoding_not_ascii;
742 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
744 PyObject* default_encoding = NULL;
745 PyObject* ascii_chars_u = NULL;
746 PyObject* ascii_chars_b = NULL;
747 const char* default_encoding_c;
748 sys = PyImport_ImportModule(
"sys");
750 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
752 if (!default_encoding)
goto bad;
753 default_encoding_c = PyBytes_AsString(default_encoding);
754 if (!default_encoding_c)
goto bad;
755 if (strcmp(default_encoding_c,
"ascii") == 0) {
756 __Pyx_sys_getdefaultencoding_not_ascii = 0;
758 char ascii_chars[128];
760 for (
c = 0;
c < 128;
c++) {
763 __Pyx_sys_getdefaultencoding_not_ascii = 1;
764 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
765 if (!ascii_chars_u)
goto bad;
766 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
767 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
770 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
774 Py_DECREF(ascii_chars_u);
775 Py_DECREF(ascii_chars_b);
777 Py_DECREF(default_encoding);
780 Py_XDECREF(default_encoding);
781 Py_XDECREF(ascii_chars_u);
782 Py_XDECREF(ascii_chars_b);
786 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
787 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
789 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
790 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
791 static char* __PYX_DEFAULT_STRING_ENCODING;
792 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
794 PyObject* default_encoding = NULL;
795 char* default_encoding_c;
796 sys = PyImport_ImportModule(
"sys");
798 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
800 if (!default_encoding)
goto bad;
801 default_encoding_c = PyBytes_AsString(default_encoding);
802 if (!default_encoding_c)
goto bad;
803 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
804 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
805 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
806 Py_DECREF(default_encoding);
809 Py_XDECREF(default_encoding);
817 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
818 #define likely(x) __builtin_expect(!!(x), 1)
819 #define unlikely(x) __builtin_expect(!!(x), 0)
821 #define likely(x) (x)
822 #define unlikely(x) (x)
824 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
826 static PyObject *__pyx_m = NULL;
827 static PyObject *__pyx_d;
828 static PyObject *__pyx_b;
829 static PyObject *__pyx_cython_runtime = NULL;
830 static PyObject *__pyx_empty_tuple;
831 static PyObject *__pyx_empty_bytes;
832 static PyObject *__pyx_empty_unicode;
833 static int __pyx_lineno;
834 static int __pyx_clineno = 0;
835 static const char * __pyx_cfilenm= __FILE__;
836 static const char *__pyx_filename;
839 #if !defined(CYTHON_CCOMPLEX)
840 #if defined(__cplusplus)
841 #define CYTHON_CCOMPLEX 1
842 #elif defined(_Complex_I)
843 #define CYTHON_CCOMPLEX 1
845 #define CYTHON_CCOMPLEX 0
855 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
857 #define _Complex_I 1.0fj
861 static const char *__pyx_f[] = {
862 "proteus/BoundaryConditions.py",
864 "proteus/BoundaryConditions.pxd",
869 struct __pyx_memoryview_obj;
871 struct __pyx_memoryview_obj *memview;
874 Py_ssize_t strides[8];
875 Py_ssize_t suboffsets[8];
876 } __Pyx_memviewslice;
877 #define __Pyx_MemoryView_Len(m) (m.shape[0])
880 #include <pythread.h>
881 #ifndef CYTHON_ATOMICS
882 #define CYTHON_ATOMICS 1
884 #define __pyx_atomic_int_type int
885 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
886 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
888 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
889 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
890 #ifdef __PYX_DEBUG_ATOMICS
891 #warning "Using GNU atomics"
893 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
895 #undef __pyx_atomic_int_type
896 #define __pyx_atomic_int_type LONG
897 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
898 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
899 #ifdef __PYX_DEBUG_ATOMICS
900 #pragma message ("Using MSVC atomics")
902 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
903 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
904 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
905 #ifdef __PYX_DEBUG_ATOMICS
906 #warning "Using Intel atomics"
909 #undef CYTHON_ATOMICS
910 #define CYTHON_ATOMICS 0
911 #ifdef __PYX_DEBUG_ATOMICS
912 #warning "Not using atomics"
915 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
917 #define __pyx_add_acquisition_count(memview)\
918 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
919 #define __pyx_sub_acquisition_count(memview)\
920 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
922 #define __pyx_add_acquisition_count(memview)\
923 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
924 #define __pyx_sub_acquisition_count(memview)\
925 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
929 #ifndef __PYX_FORCE_INIT_THREADS
930 #define __PYX_FORCE_INIT_THREADS 0
934 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
935 #define __Pyx_PyGILState_Release PyGILState_Release
936 #define __Pyx_FastGIL_Remember()
937 #define __Pyx_FastGIL_Forget()
938 #define __Pyx_FastGilFuncInit()
941 #define IS_UNSIGNED(type) (((type) -1) > 0)
942 struct __Pyx_StructField_;
943 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
946 struct __Pyx_StructField_* fields;
954 typedef struct __Pyx_StructField_ {
955 __Pyx_TypeInfo* type;
960 __Pyx_StructField* field;
961 size_t parent_offset;
962 } __Pyx_BufFmt_StackElem;
964 __Pyx_StructField root;
965 __Pyx_BufFmt_StackElem* head;
967 size_t new_count, enc_count;
968 size_t struct_alignment;
974 } __Pyx_BufFmt_Context;
984 typedef npy_int8 __pyx_t_5numpy_int8_t;
993 typedef npy_int16 __pyx_t_5numpy_int16_t;
1002 typedef npy_int32 __pyx_t_5numpy_int32_t;
1011 typedef npy_int64 __pyx_t_5numpy_int64_t;
1020 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1029 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1038 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1047 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1056 typedef npy_float32 __pyx_t_5numpy_float32_t;
1065 typedef npy_float64 __pyx_t_5numpy_float64_t;
1074 typedef npy_long __pyx_t_5numpy_int_t;
1083 typedef npy_longlong __pyx_t_5numpy_long_t;
1092 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1101 typedef npy_ulong __pyx_t_5numpy_uint_t;
1110 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1119 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1128 typedef npy_intp __pyx_t_5numpy_intp_t;
1137 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1146 typedef npy_double __pyx_t_5numpy_float_t;
1155 typedef npy_double __pyx_t_5numpy_double_t;
1164 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1168 typedef ::std::complex< float > __pyx_t_float_complex;
1170 typedef float _Complex __pyx_t_float_complex;
1173 typedef struct {
float real, imag; } __pyx_t_float_complex;
1175 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1180 typedef ::std::complex< double > __pyx_t_double_complex;
1182 typedef double _Complex __pyx_t_double_complex;
1185 typedef struct {
double real, imag; } __pyx_t_double_complex;
1187 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1191 struct __pyx_obj_18BoundaryConditions_BC_Base;
1192 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1193 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1194 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1195 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1196 struct __pyx_array_obj;
1197 struct __pyx_MemviewEnum_obj;
1198 struct __pyx_memoryview_obj;
1199 struct __pyx_memoryviewslice_obj;
1208 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1217 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1226 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1235 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1236 struct __pyx_defaults;
1237 typedef struct __pyx_defaults __pyx_defaults;
1238 struct __pyx_defaults1;
1239 typedef struct __pyx_defaults1 __pyx_defaults1;
1240 struct __pyx_defaults2;
1241 typedef struct __pyx_defaults2 __pyx_defaults2;
1250 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1251 struct __pyx_defaults {
1252 PyObject *__pyx_arg_n;
1254 struct __pyx_defaults1 {
1255 PyObject *__pyx_arg_n;
1257 struct __pyx_defaults2 {
1258 PyObject *__pyx_arg_n;
1268 struct __pyx_obj_18BoundaryConditions_BC_Base {
1270 __Pyx_memviewslice _b_or;
1286 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1288 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1289 __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1301 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1303 PyObject *__pyx_v_value;
1314 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1316 PyObject *__pyx_v_a;
1317 PyObject *__pyx_v_a0;
1328 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1330 PyObject *__pyx_v_t1;
1331 PyObject *__pyx_v_value;
1342 struct __pyx_array_obj {
1344 struct __pyx_vtabstruct_array *__pyx_vtab;
1350 Py_ssize_t *_strides;
1351 Py_ssize_t itemsize;
1354 void (*callback_free_data)(
void *);
1356 int dtype_is_object;
1367 struct __pyx_MemviewEnum_obj {
1380 struct __pyx_memoryview_obj {
1382 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1385 PyObject *_array_interface;
1386 PyThread_type_lock lock;
1387 __pyx_atomic_int acquisition_count[2];
1388 __pyx_atomic_int *acquisition_count_aligned_p;
1391 int dtype_is_object;
1392 __Pyx_TypeInfo *typeinfo;
1403 struct __pyx_memoryviewslice_obj {
1404 struct __pyx_memoryview_obj __pyx_base;
1405 __Pyx_memviewslice from_slice;
1406 PyObject *from_object;
1407 PyObject *(*to_object_func)(
char *);
1408 int (*to_dtype_func)(
char *, PyObject *);
1421 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1422 void (*resetBC)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch);
1424 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1435 struct __pyx_vtabstruct_array {
1436 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1438 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1449 struct __pyx_vtabstruct_memoryview {
1450 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1451 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1452 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1453 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1454 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1455 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1456 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1458 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1469 struct __pyx_vtabstruct__memoryviewslice {
1470 struct __pyx_vtabstruct_memoryview __pyx_base;
1472 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1476 #ifndef CYTHON_REFNANNY
1477 #define CYTHON_REFNANNY 0
1481 void (*INCREF)(
void*, PyObject*, int);
1482 void (*DECREF)(
void*, PyObject*, int);
1483 void (*GOTREF)(
void*, PyObject*, int);
1484 void (*GIVEREF)(
void*, PyObject*, int);
1485 void* (*SetupContext)(
const char*, int,
const char*);
1486 void (*FinishContext)(
void**);
1487 } __Pyx_RefNannyAPIStruct;
1488 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1489 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1490 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1492 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1494 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1495 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1496 PyGILState_Release(__pyx_gilstate_save);\
1498 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1501 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1502 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1504 #define __Pyx_RefNannyFinishContext()\
1505 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1506 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1507 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1508 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1509 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1510 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1511 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1512 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1513 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1515 #define __Pyx_RefNannyDeclarations
1516 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1517 #define __Pyx_RefNannyFinishContext()
1518 #define __Pyx_INCREF(r) Py_INCREF(r)
1519 #define __Pyx_DECREF(r) Py_DECREF(r)
1520 #define __Pyx_GOTREF(r)
1521 #define __Pyx_GIVEREF(r)
1522 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1523 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1524 #define __Pyx_XGOTREF(r)
1525 #define __Pyx_XGIVEREF(r)
1527 #define __Pyx_XDECREF_SET(r, v) do {\
1528 PyObject *tmp = (PyObject *) r;\
1529 r = v; __Pyx_XDECREF(tmp);\
1531 #define __Pyx_DECREF_SET(r, v) do {\
1532 PyObject *tmp = (PyObject *) r;\
1533 r = v; __Pyx_DECREF(tmp);\
1535 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1536 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1539 #if CYTHON_USE_TYPE_SLOTS
1540 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1542 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1546 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1549 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1552 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1553 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1554 const char* function_name);
1557 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1558 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1561 #if CYTHON_FAST_THREAD_STATE
1562 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1563 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1564 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1566 #define __Pyx_PyThreadState_declare
1567 #define __Pyx_PyThreadState_assign
1568 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1572 #if CYTHON_FAST_THREAD_STATE
1573 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1574 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1575 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1576 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1577 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1578 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1579 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1580 #if CYTHON_COMPILING_IN_CPYTHON
1581 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1583 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1586 #define __Pyx_PyErr_Clear() PyErr_Clear()
1587 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1588 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1589 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1590 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1591 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1592 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1593 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1597 #ifndef CYTHON_PROFILE
1598 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1599 #define CYTHON_PROFILE 0
1601 #define CYTHON_PROFILE 1
1604 #ifndef CYTHON_TRACE_NOGIL
1605 #define CYTHON_TRACE_NOGIL 0
1607 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1608 #define CYTHON_TRACE 1
1611 #ifndef CYTHON_TRACE
1612 #define CYTHON_TRACE 0
1615 #undef CYTHON_PROFILE_REUSE_FRAME
1617 #ifndef CYTHON_PROFILE_REUSE_FRAME
1618 #define CYTHON_PROFILE_REUSE_FRAME 0
1620 #if CYTHON_PROFILE || CYTHON_TRACE
1621 #include "compile.h"
1622 #include "frameobject.h"
1623 #include "traceback.h"
1624 #if CYTHON_PROFILE_REUSE_FRAME
1625 #define CYTHON_FRAME_MODIFIER static
1626 #define CYTHON_FRAME_DEL(frame)
1628 #define CYTHON_FRAME_MODIFIER
1629 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1631 #define __Pyx_TraceDeclarations\
1632 static PyCodeObject *__pyx_frame_code = NULL;\
1633 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1634 int __Pyx_use_tracing = 0;
1635 #define __Pyx_TraceFrameInit(codeobj)\
1636 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1638 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1640 if (CYTHON_TRACE_NOGIL) {\
1641 PyThreadState *tstate;\
1642 PyGILState_STATE state = PyGILState_Ensure();\
1643 tstate = __Pyx_PyThreadState_Current;\
1644 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1645 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1646 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1648 PyGILState_Release(state);\
1649 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1652 PyThreadState* tstate = PyThreadState_GET();\
1653 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1654 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1655 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1656 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1660 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1661 { PyThreadState* tstate = PyThreadState_GET();\
1662 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1663 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1664 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1665 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1669 #define __Pyx_TraceException()\
1670 if (likely(!__Pyx_use_tracing)); else {\
1671 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1672 if (tstate->use_tracing &&\
1673 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1675 tstate->use_tracing = 0;\
1676 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1678 if (CYTHON_TRACE && tstate->c_tracefunc)\
1679 tstate->c_tracefunc(\
1680 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1681 tstate->c_profilefunc(\
1682 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1683 Py_DECREF(exc_info);\
1685 tstate->use_tracing = 1;\
1689 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1690 PyObject *type, *value, *traceback;
1691 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1693 tstate->use_tracing = 0;
1694 if (CYTHON_TRACE && tstate->c_tracefunc)
1695 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1696 if (tstate->c_profilefunc)
1697 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1698 CYTHON_FRAME_DEL(frame);
1699 tstate->use_tracing = 1;
1701 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1704 #define __Pyx_TraceReturn(result, nogil)\
1705 if (likely(!__Pyx_use_tracing)); else {\
1707 if (CYTHON_TRACE_NOGIL) {\
1708 PyThreadState *tstate;\
1709 PyGILState_STATE state = PyGILState_Ensure();\
1710 tstate = __Pyx_PyThreadState_Current;\
1711 if (tstate->use_tracing) {\
1712 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1714 PyGILState_Release(state);\
1717 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1718 if (tstate->use_tracing) {\
1719 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1724 #define __Pyx_TraceReturn(result, nogil)\
1725 if (likely(!__Pyx_use_tracing)); else {\
1726 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1727 if (tstate->use_tracing) {\
1728 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1732 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1733 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1735 #define __Pyx_TraceDeclarations
1736 #define __Pyx_TraceFrameInit(codeobj)
1737 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1738 #define __Pyx_TraceException()
1739 #define __Pyx_TraceReturn(result, nogil)
1742 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1744 PyObject *type, *value, *traceback;
1745 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1746 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1748 tstate->use_tracing = 0;
1749 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1750 tstate->use_tracing = 1;
1753 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1757 Py_XDECREF(traceback);
1762 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1763 if (likely(!__Pyx_use_tracing)); else {\
1765 if (CYTHON_TRACE_NOGIL) {\
1767 PyThreadState *tstate;\
1768 PyGILState_STATE state = PyGILState_Ensure();\
1769 tstate = __Pyx_PyThreadState_Current;\
1770 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1771 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1773 PyGILState_Release(state);\
1774 if (unlikely(ret)) goto_error;\
1777 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1778 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1779 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1780 if (unlikely(ret)) goto_error;\
1785 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1786 if (likely(!__Pyx_use_tracing)); else {\
1787 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1788 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1789 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1790 if (unlikely(ret)) goto_error;\
1795 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1799 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1800 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1801 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1802 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1803 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1804 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1805 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1806 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1807 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1808 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1809 int wraparound,
int boundscheck);
1810 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1811 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1812 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1813 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1814 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1815 int wraparound,
int boundscheck);
1816 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1817 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1818 int is_list,
int wraparound,
int boundscheck);
1821 #if CYTHON_USE_TYPE_SLOTS
1822 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1824 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1828 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1829 #define __Pyx_MEMVIEW_DIRECT 1
1830 #define __Pyx_MEMVIEW_PTR 2
1831 #define __Pyx_MEMVIEW_FULL 4
1832 #define __Pyx_MEMVIEW_CONTIG 8
1833 #define __Pyx_MEMVIEW_STRIDED 16
1834 #define __Pyx_MEMVIEW_FOLLOW 32
1835 #define __Pyx_IS_C_CONTIG 1
1836 #define __Pyx_IS_F_CONTIG 2
1837 static int __Pyx_init_memviewslice(
1838 struct __pyx_memoryview_obj *memview,
1840 __Pyx_memviewslice *memviewslice,
1841 int memview_is_new_reference);
1842 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1843 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1844 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1845 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1846 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1847 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1848 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1849 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1850 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1851 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1854 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1857 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1860 #if CYTHON_FAST_PYCALL
1861 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1862 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1863 #if 1 || PY_VERSION_HEX < 0x030600B1
1864 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1866 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1868 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1869 (sizeof(char [1 - 2*!(cond)]) - 1)
1870 #ifndef Py_MEMBER_SIZE
1871 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1873 static size_t __pyx_pyframe_localsplus_offset = 0;
1874 #include "frameobject.h"
1875 #define __Pxy_PyFrame_Initialize_Offsets()\
1876 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1877 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1878 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1879 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1883 #if CYTHON_COMPILING_IN_CPYTHON
1884 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1886 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1890 #if CYTHON_COMPILING_IN_CPYTHON
1891 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1895 #if CYTHON_COMPILING_IN_CPYTHON
1896 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1898 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1902 #if CYTHON_FAST_PYCCALL
1903 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1905 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1909 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1912 #if CYTHON_FAST_THREAD_STATE
1913 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1914 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1916 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1920 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1923 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1926 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1927 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1928 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1929 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1930 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1931 (cache_var) = (value);
1932 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1933 static PY_UINT64_T __pyx_dict_version = 0;\
1934 static PyObject *__pyx_dict_cached_value = NULL;\
1935 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1936 (VAR) = __pyx_dict_cached_value;\
1938 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1939 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1942 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1943 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1944 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1946 #define __PYX_GET_DICT_VERSION(dict) (0)
1947 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1948 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1952 #if CYTHON_USE_DICT_VERSIONS
1953 #define __Pyx_GetModuleGlobalName(var, name) {\
1954 static PY_UINT64_T __pyx_dict_version = 0;\
1955 static PyObject *__pyx_dict_cached_value = NULL;\
1956 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1957 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1958 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1960 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1961 PY_UINT64_T __pyx_dict_version;\
1962 PyObject *__pyx_dict_cached_value;\
1963 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1965 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1967 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1968 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1969 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1973 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1976 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1977 int lineno,
const char *filename,
1978 int full_traceback,
int nogil);
1981 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
1984 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1987 #define __Pyx_CyFunction_USED 1
1988 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1989 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1990 #define __Pyx_CYFUNCTION_CCLASS 0x04
1991 #define __Pyx_CyFunction_GetClosure(f)\
1992 (((__pyx_CyFunctionObject *) (f))->func_closure)
1993 #define __Pyx_CyFunction_GetClassObj(f)\
1994 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1995 #define __Pyx_CyFunction_Defaults(type, f)\
1996 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1997 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1998 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2000 PyCFunctionObject func;
2001 #if PY_VERSION_HEX < 0x030500A0
2002 PyObject *func_weakreflist;
2004 PyObject *func_dict;
2005 PyObject *func_name;
2006 PyObject *func_qualname;
2008 PyObject *func_globals;
2009 PyObject *func_code;
2010 PyObject *func_closure;
2011 PyObject *func_classobj;
2013 int defaults_pyobjects;
2014 size_t defaults_size;
2016 PyObject *defaults_tuple;
2017 PyObject *defaults_kwdict;
2018 PyObject *(*defaults_getter)(PyObject *);
2019 PyObject *func_annotations;
2020 } __pyx_CyFunctionObject;
2021 static PyTypeObject *__pyx_CyFunctionType = 0;
2022 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2023 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2024 int flags, PyObject* qualname,
2026 PyObject *module, PyObject *globals,
2028 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2031 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2033 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2035 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2037 static int __pyx_CyFunction_init(
void);
2040 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2041 int flags, PyObject* qualname,
2043 PyObject *module, PyObject *globals,
2047 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2050 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2051 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2052 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2053 int has_cstart,
int has_cstop,
int wraparound);
2056 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2059 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2062 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2063 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2064 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2065 (likely(PyDict_CheckExact(obj)) ?\
2066 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2068 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2069 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2073 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2076 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2079 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2082 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2085 #if CYTHON_USE_EXC_INFO_STACK
2086 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2090 #if CYTHON_FAST_THREAD_STATE
2091 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2092 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2093 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2094 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2096 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2097 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2101 #if CYTHON_FAST_THREAD_STATE
2102 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2103 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2105 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2109 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2110 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2111 __Pyx__ArgTypeTest(obj, type, name, exact))
2112 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2118 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2121 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2124 #if PY_MAJOR_VERSION >= 3
2125 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2127 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2131 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2134 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2135 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2137 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2138 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2140 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2142 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2144 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2146 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2148 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2150 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2154 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2155 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2156 const char* encoding,
const char* errors,
2157 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2160 #if CYTHON_FAST_THREAD_STATE
2161 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2162 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2164 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2168 #if CYTHON_COMPILING_IN_CPYTHON
2169 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2170 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2171 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2172 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2174 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2175 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2176 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2178 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2180 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2182 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2183 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2184 PyListObject*
L = (PyListObject*) list;
2185 Py_ssize_t len = Py_SIZE(list);
2186 if (likely(
L->allocated > len)) {
2188 PyList_SET_ITEM(list, len, x);
2189 __Pyx_SET_SIZE(list, len + 1);
2192 return PyList_Append(list, x);
2195 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2199 #if !CYTHON_COMPILING_IN_PYPY
2200 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2202 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2203 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2207 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2208 #if CYTHON_COMPILING_IN_CPYTHON
2209 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2210 if (unlikely(!none))
2215 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2220 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2221 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2222 PyListObject*
L = (PyListObject*) list;
2223 Py_ssize_t len = Py_SIZE(list);
2224 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2226 PyList_SET_ITEM(list, len, x);
2227 __Pyx_SET_SIZE(list, len + 1);
2230 return PyList_Append(list, x);
2233 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2237 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2240 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2243 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2244 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2246 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2250 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2251 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2253 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2257 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2260 static int __Pyx_setup_reduce(PyObject* type_obj);
2263 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2266 #ifndef __PYX_HAVE_RT_ImportType_proto
2267 #define __PYX_HAVE_RT_ImportType_proto
2268 enum __Pyx_ImportType_CheckSize {
2269 __Pyx_ImportType_CheckSize_Error = 0,
2270 __Pyx_ImportType_CheckSize_Warn = 1,
2271 __Pyx_ImportType_CheckSize_Ignore = 2
2273 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2277 #ifdef CYTHON_CLINE_IN_TRACEBACK
2278 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2280 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2285 PyCodeObject* code_object;
2287 } __Pyx_CodeObjectCacheEntry;
2288 struct __Pyx_CodeObjectCache {
2291 __Pyx_CodeObjectCacheEntry* entries;
2293 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2294 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2295 static PyCodeObject *__pyx_find_code_object(
int code_line);
2296 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2299 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2300 int py_line,
const char *filename);
2302 #if PY_MAJOR_VERSION < 3
2303 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2304 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2306 #define __Pyx_GetBuffer PyObject_GetBuffer
2307 #define __Pyx_ReleaseBuffer PyBuffer_Release
2313 Py_ssize_t shape, strides, suboffsets;
2314 } __Pyx_Buf_DimInfo;
2320 __Pyx_Buffer *rcbuffer;
2322 __Pyx_Buf_DimInfo diminfo[8];
2323 } __Pyx_LocalBuf_ND;
2326 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2329 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2330 __Pyx_memviewslice *slice2,
2331 int ndim,
size_t itemsize);
2334 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2337 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2338 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2341 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2344 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2345 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2346 __Pyx_BufFmt_StackElem* stack,
2347 __Pyx_TypeInfo* type);
2350 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2353 static int __Pyx_ValidateAndInit_memviewslice(
2358 __Pyx_TypeInfo *dtype,
2359 __Pyx_BufFmt_StackElem stack[],
2360 __Pyx_memviewslice *memviewslice,
2361 PyObject *original_obj);
2364 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2375 #define __Pyx_CREAL(z) ((z).real())
2376 #define __Pyx_CIMAG(z) ((z).imag())
2378 #define __Pyx_CREAL(z) (__real__(z))
2379 #define __Pyx_CIMAG(z) (__imag__(z))
2382 #define __Pyx_CREAL(z) ((z).real)
2383 #define __Pyx_CIMAG(z) ((z).imag)
2385 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2386 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2387 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2388 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2390 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2391 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2396 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2397 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2398 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2399 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2400 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2401 #define __Pyx_c_neg_float(a) (-(a))
2403 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2404 #define __Pyx_c_conj_float(z) (::std::conj(z))
2406 #define __Pyx_c_abs_float(z) (::std::abs(z))
2407 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2410 #define __Pyx_c_is_zero_float(z) ((z)==0)
2411 #define __Pyx_c_conj_float(z) (conjf(z))
2413 #define __Pyx_c_abs_float(z) (cabsf(z))
2414 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2418 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2419 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2420 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2421 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2422 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2423 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2424 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2425 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2427 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2428 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2434 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2435 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2436 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2437 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2438 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2439 #define __Pyx_c_neg_double(a) (-(a))
2441 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2442 #define __Pyx_c_conj_double(z) (::std::conj(z))
2444 #define __Pyx_c_abs_double(z) (::std::abs(z))
2445 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2448 #define __Pyx_c_is_zero_double(z) ((z)==0)
2449 #define __Pyx_c_conj_double(z) (conj(z))
2451 #define __Pyx_c_abs_double(z) (cabs(z))
2452 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2456 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2457 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2458 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2459 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2460 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2461 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2462 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2463 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2465 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2466 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2471 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2474 static __Pyx_memviewslice
2475 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2476 const char *mode,
int ndim,
2477 size_t sizeof_dtype,
int contig_flag,
2478 int dtype_is_object);
2481 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2484 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2487 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2490 static int __Pyx_check_binary_version(
void);
2493 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2495 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch);
2496 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2497 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2498 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2499 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2500 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2501 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2502 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2503 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2504 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2505 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2520 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2533 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2534 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2535 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2536 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2537 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2538 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2541 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2542 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2543 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2544 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2545 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2546 static PyTypeObject *__pyx_array_type = 0;
2547 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2548 static PyTypeObject *__pyx_memoryview_type = 0;
2549 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2550 static PyObject *
generic = 0;
2551 static PyObject *strided = 0;
2552 static PyObject *indirect = 0;
2553 static PyObject *contiguous = 0;
2554 static PyObject *indirect_contiguous = 0;
2555 static int __pyx_memoryview_thread_locks_used;
2556 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2557 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *);
2558 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2559 static void *__pyx_align_pointer(
void *,
size_t);
2560 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2561 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2562 static PyObject *_unellipsify(PyObject *,
int);
2563 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2564 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2565 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2566 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2567 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2568 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2569 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2570 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2571 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2572 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2573 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2574 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2575 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2576 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2577 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2578 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2579 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2580 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2581 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2582 static int __pyx_memoryview_err(PyObject *,
char *);
2583 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2584 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2585 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2586 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2587 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2588 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2589 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2590 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2591 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2592 #define __Pyx_MODULE_NAME "BoundaryConditions"
2593 extern int __pyx_module_is_main_BoundaryConditions;
2594 int __pyx_module_is_main_BoundaryConditions = 0;
2597 static PyObject *__pyx_builtin_sum;
2598 static PyObject *__pyx_builtin_TypeError;
2599 static PyObject *__pyx_builtin_RuntimeError;
2600 static PyObject *__pyx_builtin_ValueError;
2601 static PyObject *__pyx_builtin_ImportError;
2602 static PyObject *__pyx_builtin_MemoryError;
2603 static PyObject *__pyx_builtin_enumerate;
2604 static PyObject *__pyx_builtin_range;
2605 static PyObject *__pyx_builtin_Ellipsis;
2606 static PyObject *__pyx_builtin_id;
2607 static PyObject *__pyx_builtin_IndexError;
2608 static const char __pyx_k_O[] =
"O";
2609 static const char __pyx_k_a[] =
"a";
2610 static const char __pyx_k_c[] =
"c";
2611 static const char __pyx_k_n[] =
"n";
2612 static const char __pyx_k_t[] =
"t";
2613 static const char __pyx_k_x[] =
"x";
2614 static const char __pyx_k_a0[] =
"a0";
2615 static const char __pyx_k_id[] =
"id";
2616 static const char __pyx_k_nd[] =
"nd";
2617 static const char __pyx_k_np[] =
"np";
2618 static const char __pyx_k_t1[] =
"t1";
2619 static const char __pyx_k_all[] =
"__all__";
2620 static const char __pyx_k_b_i[] =
"b_i";
2621 static const char __pyx_k_get[] =
"get";
2622 static const char __pyx_k_new[] =
"__new__";
2623 static const char __pyx_k_obj[] =
"obj";
2624 static const char __pyx_k_sum[] =
"sum";
2625 static const char __pyx_k_None[] =
"None";
2626 static const char __pyx_k_b_or[] =
"b_or";
2627 static const char __pyx_k_base[] =
"base";
2628 static const char __pyx_k_dict[] =
"__dict__";
2629 static const char __pyx_k_main[] =
"__main__";
2630 static const char __pyx_k_mode[] =
"mode";
2631 static const char __pyx_k_name[] =
"name";
2632 static const char __pyx_k_ndim[] =
"ndim";
2633 static const char __pyx_k_pack[] =
"pack";
2634 static const char __pyx_k_self[] =
"self";
2635 static const char __pyx_k_size[] =
"size";
2636 static const char __pyx_k_step[] =
"step";
2637 static const char __pyx_k_stop[] =
"stop";
2638 static const char __pyx_k_test[] =
"__test__";
2639 static const char __pyx_k_ASCII[] =
"ASCII";
2640 static const char __pyx_k_class[] =
"__class__";
2641 static const char __pyx_k_error[] =
"error";
2642 static const char __pyx_k_flags[] =
"flags";
2643 static const char __pyx_k_numpy[] =
"numpy";
2644 static const char __pyx_k_range[] =
"range";
2645 static const char __pyx_k_shape[] =
"shape";
2646 static const char __pyx_k_start[] =
"start";
2647 static const char __pyx_k_state[] =
"state";
2648 static const char __pyx_k_value[] =
"value";
2649 static const char __pyx_k_zeros[] =
"zeros";
2650 static const char __pyx_k_Domain[] =
"Domain";
2651 static const char __pyx_k_dict_2[] =
"_dict";
2652 static const char __pyx_k_encode[] =
"encode";
2653 static const char __pyx_k_format[] =
"format";
2654 static const char __pyx_k_import[] =
"__import__";
2655 static const char __pyx_k_name_2[] =
"__name__";
2656 static const char __pyx_k_pickle[] =
"pickle";
2657 static const char __pyx_k_reduce[] =
"__reduce__";
2658 static const char __pyx_k_struct[] =
"struct";
2659 static const char __pyx_k_unpack[] =
"unpack";
2660 static const char __pyx_k_update[] =
"update";
2661 static const char __pyx_k_BC_Base[] =
"BC_Base";
2662 static const char __pyx_k_Context[] =
"Context";
2663 static const char __pyx_k_context[] =
"context";
2664 static const char __pyx_k_fortran[] =
"fortran";
2665 static const char __pyx_k_memview[] =
"memview";
2666 static const char __pyx_k_proteus[] =
"proteus";
2667 static const char __pyx_k_resetBC[] =
"resetBC";
2668 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2669 static const char __pyx_k_getstate[] =
"__getstate__";
2670 static const char __pyx_k_itemsize[] =
"itemsize";
2671 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2672 static const char __pyx_k_setstate[] =
"__setstate__";
2673 static const char __pyx_k_TypeError[] =
"TypeError";
2674 static const char __pyx_k_enumerate[] =
"enumerate";
2675 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2676 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2677 static const char __pyx_k_IndexError[] =
"IndexError";
2678 static const char __pyx_k_ValueError[] =
"ValueError";
2679 static const char __pyx_k_getContext[] =
"getContext";
2680 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2681 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2682 static const char __pyx_k_ImportError[] =
"ImportError";
2683 static const char __pyx_k_MemoryError[] =
"MemoryError";
2684 static const char __pyx_k_PickleError[] =
"PickleError";
2685 static const char __pyx_k_init_cython[] =
"init_cython";
2686 static const char __pyx_k_setLinearBC[] =
"setLinearBC";
2687 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2688 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2689 static const char __pyx_k_stringsource[] =
"stringsource";
2690 static const char __pyx_k_use_setstate[] =
"use_setstate";
2691 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2692 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2693 static const char __pyx_k_setConstantBC[] =
"setConstantBC";
2694 static const char __pyx_k_setLinearRamp[] =
"setLinearRamp";
2695 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2696 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2697 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2698 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2699 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2700 static const char __pyx_k_BoundaryCondition[] =
"BoundaryCondition";
2701 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2702 static const char __pyx_k_BC_Base_getContext[] =
"BC_Base.getContext";
2703 static const char __pyx_k_BoundaryConditions[] =
"BoundaryConditions";
2704 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2705 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2706 static const char __pyx_k_pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base";
2707 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2708 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2709 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2710 static const char __pyx_k_BC_Base___reduce_cython[] =
"BC_Base.__reduce_cython__";
2711 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2712 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2713 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2714 static const char __pyx_k_BC_Base___setstate_cython[] =
"BC_Base.__setstate_cython__";
2715 static const char __pyx_k_BoundaryCondition_resetBC[] =
"BoundaryCondition.resetBC";
2716 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2717 static const char __pyx_k_setLinearBC_locals_lambda[] =
"setLinearBC.<locals>.<lambda>";
2718 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2719 static const char __pyx_k_setConstantBC_locals_lambda[] =
"setConstantBC.<locals>.<lambda>";
2720 static const char __pyx_k_setLinearRamp_locals_lambda[] =
"setLinearRamp.<locals>.<lambda>";
2721 static const char __pyx_k_BoundaryCondition_init_cython[] =
"BoundaryCondition.init_cython";
2722 static const char __pyx_k_BoundaryCondition_setLinearBC[] =
"BoundaryCondition.setLinearBC";
2723 static const char __pyx_k_proteus_BoundaryConditions_py[] =
"proteus/BoundaryConditions.py";
2724 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2725 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2726 static const char __pyx_k_BoundaryCondition_setConstantBC[] =
"BoundaryCondition.setConstantBC";
2727 static const char __pyx_k_BoundaryCondition_setLinearRamp[] =
"BoundaryCondition.setLinearRamp";
2728 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2729 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] =
"self.uuOfXT cannot be converted to a Python object for pickling";
2730 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2731 static const char __pyx_k_BoundaryCondition___reduce_cytho[] =
"BoundaryCondition.__reduce_cython__";
2732 static const char __pyx_k_BoundaryCondition___setstate_cyt[] =
"BoundaryCondition.__setstate_cython__";
2733 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2734 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2735 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2736 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2737 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2738 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2739 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] =
"Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2740 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2741 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2742 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2743 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2744 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2745 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] =
"Shape or nd must be passed to BC";
2746 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2747 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2748 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2749 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2750 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2751 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2752 static PyObject *__pyx_n_s_ASCII;
2753 static PyObject *__pyx_n_s_BC_Base;
2754 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2755 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2756 static PyObject *__pyx_n_s_BC_Base_getContext;
2757 static PyObject *__pyx_n_s_BoundaryCondition;
2758 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2759 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2760 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2761 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2762 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2763 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2764 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2765 static PyObject *__pyx_n_s_BoundaryConditions;
2766 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2767 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2768 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2769 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2770 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2771 static PyObject *__pyx_n_s_Context;
2772 static PyObject *__pyx_n_s_Domain;
2773 static PyObject *__pyx_n_s_Ellipsis;
2774 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2775 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2776 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2777 static PyObject *__pyx_n_s_ImportError;
2778 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2779 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2780 static PyObject *__pyx_n_s_IndexError;
2781 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2782 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2783 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2784 static PyObject *__pyx_n_s_MemoryError;
2785 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2786 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2787 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2788 static PyObject *__pyx_n_s_None;
2789 static PyObject *__pyx_n_b_O;
2790 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2791 static PyObject *__pyx_n_s_PickleError;
2792 static PyObject *__pyx_n_s_RuntimeError;
2793 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2794 static PyObject *__pyx_n_s_TypeError;
2795 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2796 static PyObject *__pyx_n_s_ValueError;
2797 static PyObject *__pyx_n_s_View_MemoryView;
2798 static PyObject *__pyx_n_s_a;
2799 static PyObject *__pyx_n_s_a0;
2800 static PyObject *__pyx_n_s_all;
2801 static PyObject *__pyx_n_s_allocate_buffer;
2802 static PyObject *__pyx_n_s_b_i;
2803 static PyObject *__pyx_n_s_b_or;
2804 static PyObject *__pyx_n_s_base;
2805 static PyObject *__pyx_n_s_c;
2806 static PyObject *__pyx_n_u_c;
2807 static PyObject *__pyx_n_s_class;
2808 static PyObject *__pyx_n_s_cline_in_traceback;
2809 static PyObject *__pyx_n_s_context;
2810 static PyObject *__pyx_kp_s_contiguous_and_direct;
2811 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2812 static PyObject *__pyx_n_s_dict;
2813 static PyObject *__pyx_n_s_dict_2;
2814 static PyObject *__pyx_n_s_dtype_is_object;
2815 static PyObject *__pyx_n_s_encode;
2816 static PyObject *__pyx_n_s_enumerate;
2817 static PyObject *__pyx_n_s_error;
2818 static PyObject *__pyx_n_s_flags;
2819 static PyObject *__pyx_n_s_format;
2820 static PyObject *__pyx_n_s_fortran;
2821 static PyObject *__pyx_n_u_fortran;
2822 static PyObject *__pyx_n_s_get;
2823 static PyObject *__pyx_n_s_getContext;
2824 static PyObject *__pyx_n_s_getstate;
2825 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2826 static PyObject *__pyx_n_s_id;
2827 static PyObject *__pyx_n_s_import;
2828 static PyObject *__pyx_n_s_init_cython;
2829 static PyObject *__pyx_n_s_itemsize;
2830 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2831 static PyObject *__pyx_n_s_main;
2832 static PyObject *__pyx_n_s_memview;
2833 static PyObject *__pyx_n_s_mode;
2834 static PyObject *__pyx_n_s_n;
2835 static PyObject *__pyx_n_s_name;
2836 static PyObject *__pyx_n_s_name_2;
2837 static PyObject *__pyx_n_s_nd;
2838 static PyObject *__pyx_n_s_ndim;
2839 static PyObject *__pyx_n_s_new;
2840 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2841 static PyObject *__pyx_n_s_np;
2842 static PyObject *__pyx_n_s_numpy;
2843 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2844 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2845 static PyObject *__pyx_n_s_obj;
2846 static PyObject *__pyx_n_s_pack;
2847 static PyObject *__pyx_n_s_pickle;
2848 static PyObject *__pyx_n_s_proteus;
2849 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2850 static PyObject *__pyx_n_s_pyx_PickleError;
2851 static PyObject *__pyx_n_s_pyx_checksum;
2852 static PyObject *__pyx_n_s_pyx_getbuffer;
2853 static PyObject *__pyx_n_s_pyx_result;
2854 static PyObject *__pyx_n_s_pyx_state;
2855 static PyObject *__pyx_n_s_pyx_type;
2856 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2857 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2858 static PyObject *__pyx_n_s_pyx_vtable;
2859 static PyObject *__pyx_n_s_range;
2860 static PyObject *__pyx_n_s_reduce;
2861 static PyObject *__pyx_n_s_reduce_cython;
2862 static PyObject *__pyx_n_s_reduce_ex;
2863 static PyObject *__pyx_n_s_resetBC;
2864 static PyObject *__pyx_n_s_self;
2865 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2866 static PyObject *__pyx_n_s_setConstantBC;
2867 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2868 static PyObject *__pyx_n_s_setLinearBC;
2869 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2870 static PyObject *__pyx_n_s_setLinearRamp;
2871 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2872 static PyObject *__pyx_n_s_setstate;
2873 static PyObject *__pyx_n_s_setstate_cython;
2874 static PyObject *__pyx_n_s_shape;
2875 static PyObject *__pyx_n_s_size;
2876 static PyObject *__pyx_n_s_start;
2877 static PyObject *__pyx_n_s_state;
2878 static PyObject *__pyx_n_s_step;
2879 static PyObject *__pyx_n_s_stop;
2880 static PyObject *__pyx_kp_s_strided_and_direct;
2881 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2882 static PyObject *__pyx_kp_s_strided_and_indirect;
2883 static PyObject *__pyx_kp_s_stringsource;
2884 static PyObject *__pyx_n_s_struct;
2885 static PyObject *__pyx_n_s_sum;
2886 static PyObject *__pyx_n_s_t;
2887 static PyObject *__pyx_n_s_t1;
2888 static PyObject *__pyx_n_s_test;
2889 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2890 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2891 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2892 static PyObject *__pyx_n_s_unpack;
2893 static PyObject *__pyx_n_s_update;
2894 static PyObject *__pyx_n_s_use_setstate;
2895 static PyObject *__pyx_n_s_value;
2896 static PyObject *__pyx_n_s_x;
2897 static PyObject *__pyx_n_s_zeros;
2898 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd);
2899 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context);
2900 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2901 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2902 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2903 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2904 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2905 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2906 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2907 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2908 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2909 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2910 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2911 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2912 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2913 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2914 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2915 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2916 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2917 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2918 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2919 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2920 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2921 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2922 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2923 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2924 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a);
2925 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2926 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2927 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value);
2928 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2929 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2930 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2931 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2932 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2933 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2934 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2935 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2936 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2937 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2938 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2939 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2940 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2941 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2942 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2943 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2944 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2945 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2946 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2947 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2948 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2949 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2950 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2951 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2952 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2953 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2954 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2955 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2956 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2957 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2958 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2959 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2960 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2961 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2962 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2963 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2964 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2965 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2966 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2967 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2968 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2969 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2970 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2971 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2972 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2973 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2974 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2975 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2976 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k);
2977 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k);
2978 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k);
2979 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k);
2980 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k);
2981 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2982 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2983 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2984 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2985 static PyObject *__pyx_int_0;
2986 static PyObject *__pyx_int_1;
2987 static PyObject *__pyx_int_3;
2988 static PyObject *__pyx_int_158231071;
2989 static PyObject *__pyx_int_184977713;
2990 static PyObject *__pyx_int_neg_1;
2991 static PyObject *__pyx_codeobj_;
2992 static PyObject *__pyx_slice__7;
2993 static PyObject *__pyx_tuple__11;
2994 static PyObject *__pyx_tuple__13;
2995 static PyObject *__pyx_tuple__15;
2996 static PyObject *__pyx_tuple__16;
2997 static PyObject *__pyx_tuple__17;
2998 static PyObject *__pyx_tuple__18;
2999 static PyObject *__pyx_tuple__19;
3000 static PyObject *__pyx_tuple__20;
3001 static PyObject *__pyx_tuple__21;
3002 static PyObject *__pyx_tuple__22;
3003 static PyObject *__pyx_tuple__23;
3004 static PyObject *__pyx_tuple__24;
3005 static PyObject *__pyx_tuple__25;
3006 static PyObject *__pyx_tuple__26;
3007 static PyObject *__pyx_tuple__27;
3008 static PyObject *__pyx_tuple__28;
3009 static PyObject *__pyx_tuple__29;
3010 static PyObject *__pyx_tuple__30;
3011 static PyObject *__pyx_tuple__31;
3012 static PyObject *__pyx_tuple__32;
3013 static PyObject *__pyx_tuple__33;
3014 static PyObject *__pyx_tuple__34;
3015 static PyObject *__pyx_tuple__35;
3016 static PyObject *__pyx_tuple__36;
3017 static PyObject *__pyx_tuple__38;
3018 static PyObject *__pyx_tuple__39;
3019 static PyObject *__pyx_tuple__40;
3020 static PyObject *__pyx_tuple__41;
3021 static PyObject *__pyx_tuple__42;
3022 static PyObject *__pyx_tuple__43;
3023 static PyObject *__pyx_tuple__44;
3024 static PyObject *__pyx_tuple__45;
3025 static PyObject *__pyx_tuple__46;
3026 static PyObject *__pyx_tuple__47;
3027 static PyObject *__pyx_tuple__48;
3028 static PyObject *__pyx_tuple__49;
3029 static PyObject *__pyx_tuple__50;
3030 static PyObject *__pyx_tuple__51;
3031 static PyObject *__pyx_tuple__52;
3032 static PyObject *__pyx_tuple__53;
3033 static PyObject *__pyx_tuple__54;
3034 static PyObject *__pyx_codeobj__2;
3035 static PyObject *__pyx_codeobj__3;
3036 static PyObject *__pyx_codeobj__4;
3037 static PyObject *__pyx_codeobj__5;
3038 static PyObject *__pyx_codeobj__6;
3039 static PyObject *__pyx_codeobj__8;
3040 static PyObject *__pyx_codeobj__9;
3041 static PyObject *__pyx_codeobj__10;
3042 static PyObject *__pyx_codeobj__12;
3043 static PyObject *__pyx_codeobj__14;
3044 static PyObject *__pyx_codeobj__37;
3056 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3057 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3058 PyObject *__pyx_v_shape = 0;
3059 PyObject *__pyx_v_name = 0;
3060 PyObject *__pyx_v_b_or = 0;
3061 PyObject *__pyx_v_b_i = 0;
3062 PyObject *__pyx_v_nd = 0;
3063 int __pyx_lineno = 0;
3064 const char *__pyx_filename = NULL;
3065 int __pyx_clineno = 0;
3067 __Pyx_RefNannyDeclarations
3068 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3070 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3071 PyObject* values[5] = {0,0,0,0,0};
3072 values[0] = ((PyObject *)Py_None);
3073 values[1] = ((PyObject *)Py_None);
3074 values[2] = ((PyObject *)Py_None);
3075 values[3] = ((PyObject *)__pyx_int_0);
3076 values[4] = ((PyObject *)Py_None);
3077 if (unlikely(__pyx_kwds)) {
3079 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3081 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3083 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3085 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3087 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3089 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3092 default:
goto __pyx_L5_argtuple_error;
3094 kw_args = PyDict_Size(__pyx_kwds);
3098 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3099 if (value) { values[0] = value; kw_args--; }
3104 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3105 if (value) { values[1] = value; kw_args--; }
3110 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3111 if (value) { values[2] = value; kw_args--; }
3116 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3117 if (value) { values[3] = value; kw_args--; }
3122 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3123 if (value) { values[4] = value; kw_args--; }
3126 if (unlikely(kw_args > 0)) {
3127 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3130 switch (PyTuple_GET_SIZE(__pyx_args)) {
3131 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3133 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3135 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3137 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3139 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3142 default:
goto __pyx_L5_argtuple_error;
3145 __pyx_v_shape = values[0];
3146 __pyx_v_name = values[1];
3147 __pyx_v_b_or = values[2];
3148 __pyx_v_b_i = values[3];
3149 __pyx_v_nd = values[4];
3151 goto __pyx_L4_argument_unpacking_done;
3152 __pyx_L5_argtuple_error:;
3153 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3155 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3156 __Pyx_RefNannyFinishContext();
3158 __pyx_L4_argument_unpacking_done:;
3159 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3162 __Pyx_RefNannyFinishContext();
3166 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3168 __Pyx_TraceDeclarations
3169 __Pyx_RefNannyDeclarations
3170 PyObject *__pyx_t_1 = NULL;
3173 PyObject *__pyx_t_4 = NULL;
3175 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3176 int __pyx_lineno = 0;
3177 const char *__pyx_filename = NULL;
3178 int __pyx_clineno = 0;
3179 __Pyx_RefNannySetupContext(
"__init__", 0);
3180 __Pyx_TraceCall(
"__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3189 __Pyx_INCREF(__pyx_v_shape);
3190 __Pyx_GIVEREF(__pyx_v_shape);
3191 __Pyx_GOTREF(__pyx_v_self->Shape);
3192 __Pyx_DECREF(__pyx_v_self->Shape);
3193 __pyx_v_self->Shape = __pyx_v_shape;
3202 if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3203 __pyx_t_1 = __pyx_v_name;
3204 __Pyx_INCREF(__pyx_t_1);
3205 __Pyx_GIVEREF(__pyx_t_1);
3206 __Pyx_GOTREF(__pyx_v_self->name);
3207 __Pyx_DECREF(__pyx_v_self->name);
3208 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3218 __Pyx_INCREF(__pyx_n_s_None);
3219 __Pyx_GIVEREF(__pyx_n_s_None);
3220 __Pyx_GOTREF(__pyx_v_self->BC_type);
3221 __Pyx_DECREF(__pyx_v_self->BC_type);
3222 __pyx_v_self->BC_type = __pyx_n_s_None;
3231 __pyx_t_2 = (__pyx_v_shape != Py_None);
3232 __pyx_t_3 = (__pyx_t_2 != 0);
3242 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3243 __Pyx_GOTREF(__pyx_t_1);
3244 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3245 __Pyx_GOTREF(__pyx_t_4);
3246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3247 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3248 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3249 __pyx_v_self->nd = __pyx_t_5;
3268 __pyx_t_3 = (__pyx_v_nd != Py_None);
3269 __pyx_t_2 = (__pyx_t_3 != 0);
3279 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3280 __pyx_v_self->nd = __pyx_t_5;
3300 #ifndef CYTHON_WITHOUT_ASSERTIONS
3301 if (unlikely(!Py_OptimizeFlag)) {
3302 __pyx_t_2 = (__pyx_v_nd != Py_None);
3303 if (unlikely(!(__pyx_t_2 != 0))) {
3304 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3305 __PYX_ERR(0, 33, __pyx_L1_error)
3319 __pyx_t_2 = (__pyx_v_b_or != Py_None);
3320 __pyx_t_3 = (__pyx_t_2 != 0);
3330 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3331 __Pyx_GOTREF(__pyx_t_4);
3332 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3333 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3334 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3335 __pyx_v_self->_b_or = __pyx_t_6;
3336 __pyx_t_6.memview = NULL;
3337 __pyx_t_6.data = NULL;
3357 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3358 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3359 __pyx_v_self->_b_or = __pyx_t_6;
3360 __pyx_t_6.memview = NULL;
3361 __pyx_t_6.data = NULL;
3377 __Pyx_XDECREF(__pyx_t_1);
3378 __Pyx_XDECREF(__pyx_t_4);
3379 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3380 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3383 __Pyx_TraceReturn(Py_None, 0);
3384 __Pyx_RefNannyFinishContext();
3397 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3398 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] =
"BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3399 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3400 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3401 PyObject *__pyx_v_context = 0;
3402 int __pyx_lineno = 0;
3403 const char *__pyx_filename = NULL;
3404 int __pyx_clineno = 0;
3405 PyObject *__pyx_r = 0;
3406 __Pyx_RefNannyDeclarations
3407 __Pyx_RefNannySetupContext(
"getContext (wrapper)", 0);
3409 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3410 PyObject* values[1] = {0};
3411 values[0] = ((PyObject *)Py_None);
3412 if (unlikely(__pyx_kwds)) {
3414 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3416 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3419 default:
goto __pyx_L5_argtuple_error;
3421 kw_args = PyDict_Size(__pyx_kwds);
3425 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3426 if (value) { values[0] = value; kw_args--; }
3429 if (unlikely(kw_args > 0)) {
3430 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3433 switch (PyTuple_GET_SIZE(__pyx_args)) {
3434 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3437 default:
goto __pyx_L5_argtuple_error;
3440 __pyx_v_context = values[0];
3442 goto __pyx_L4_argument_unpacking_done;
3443 __pyx_L5_argtuple_error:;
3444 __Pyx_RaiseArgtupleInvalid(
"getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3446 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3447 __Pyx_RefNannyFinishContext();
3449 __pyx_L4_argument_unpacking_done:;
3450 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3453 __Pyx_RefNannyFinishContext();
3457 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3458 PyObject *__pyx_v_Context = NULL;
3459 PyObject *__pyx_r = NULL;
3460 __Pyx_TraceDeclarations
3461 __Pyx_RefNannyDeclarations
3463 PyObject *__pyx_t_2 = NULL;
3464 PyObject *__pyx_t_3 = NULL;
3465 PyObject *__pyx_t_4 = NULL;
3466 int __pyx_lineno = 0;
3467 const char *__pyx_filename = NULL;
3468 int __pyx_clineno = 0;
3469 __Pyx_TraceFrameInit(__pyx_codeobj_)
3470 __Pyx_RefNannySetupContext(
"getContext", 0);
3471 __Pyx_TraceCall(
"getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3480 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3490 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3491 __Pyx_GOTREF(__pyx_t_2);
3492 __Pyx_INCREF(__pyx_n_s_Context);
3493 __Pyx_GIVEREF(__pyx_n_s_Context);
3494 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3495 __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3496 __Pyx_GOTREF(__pyx_t_3);
3497 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3498 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3499 __Pyx_GOTREF(__pyx_t_2);
3500 __Pyx_INCREF(__pyx_t_2);
3501 __pyx_v_Context = __pyx_t_2;
3502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3503 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3512 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3513 __Pyx_GOTREF(__pyx_t_2);
3515 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3516 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3517 if (likely(__pyx_t_4)) {
3518 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3519 __Pyx_INCREF(__pyx_t_4);
3520 __Pyx_INCREF(
function);
3521 __Pyx_DECREF_SET(__pyx_t_2,
function);
3524 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3525 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3526 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3527 __Pyx_GOTREF(__pyx_t_3);
3528 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3529 __Pyx_GIVEREF(__pyx_t_3);
3530 __Pyx_GOTREF(__pyx_v_self->ct);
3531 __Pyx_DECREF(__pyx_v_self->ct);
3532 __pyx_v_self->ct = __pyx_t_3;
3553 __Pyx_INCREF(__pyx_v_context);
3554 __Pyx_GIVEREF(__pyx_v_context);
3555 __Pyx_GOTREF(__pyx_v_self->ct);
3556 __Pyx_DECREF(__pyx_v_self->ct);
3557 __pyx_v_self->ct = __pyx_v_context;
3570 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3573 __Pyx_XDECREF(__pyx_t_2);
3574 __Pyx_XDECREF(__pyx_t_3);
3575 __Pyx_XDECREF(__pyx_t_4);
3576 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3579 __Pyx_XDECREF(__pyx_v_Context);
3580 __Pyx_XGIVEREF(__pyx_r);
3581 __Pyx_TraceReturn(__pyx_r, 0);
3582 __Pyx_RefNannyFinishContext();
3595 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self);
3596 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3597 PyObject *__pyx_r = 0;
3598 __Pyx_RefNannyDeclarations
3599 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3600 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3603 __Pyx_RefNannyFinishContext();
3607 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3608 PyObject *__pyx_r = NULL;
3609 __Pyx_TraceDeclarations
3610 __Pyx_RefNannyDeclarations
3611 PyObject *__pyx_t_1 = NULL;
3612 int __pyx_lineno = 0;
3613 const char *__pyx_filename = NULL;
3614 int __pyx_clineno = 0;
3615 __Pyx_RefNannySetupContext(
"__get__", 0);
3616 __Pyx_TraceCall(
"__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3617 __Pyx_XDECREF(__pyx_r);
3618 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3619 __Pyx_GOTREF(__pyx_t_1);
3620 __pyx_r = __pyx_t_1;
3626 __Pyx_XDECREF(__pyx_t_1);
3627 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3630 __Pyx_XGIVEREF(__pyx_r);
3631 __Pyx_TraceReturn(__pyx_r, 0);
3632 __Pyx_RefNannyFinishContext();
3637 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3638 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3640 __Pyx_RefNannyDeclarations
3641 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3642 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3645 __Pyx_RefNannyFinishContext();
3649 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3651 __Pyx_TraceDeclarations
3652 __Pyx_RefNannyDeclarations
3654 int __pyx_lineno = 0;
3655 const char *__pyx_filename = NULL;
3656 int __pyx_clineno = 0;
3657 __Pyx_RefNannySetupContext(
"__set__", 0);
3658 __Pyx_TraceCall(
"__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3659 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3660 __pyx_v_self->nd = __pyx_t_1;
3666 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3669 __Pyx_TraceReturn(Py_None, 0);
3670 __Pyx_RefNannyFinishContext();
3683 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self);
3684 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3685 PyObject *__pyx_r = 0;
3686 __Pyx_RefNannyDeclarations
3687 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3688 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3691 __Pyx_RefNannyFinishContext();
3695 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3696 PyObject *__pyx_r = NULL;
3697 __Pyx_TraceDeclarations
3698 __Pyx_RefNannyDeclarations
3699 int __pyx_lineno = 0;
3700 const char *__pyx_filename = NULL;
3701 int __pyx_clineno = 0;
3702 __Pyx_RefNannySetupContext(
"__get__", 0);
3703 __Pyx_TraceCall(
"__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3704 __Pyx_XDECREF(__pyx_r);
3705 __Pyx_INCREF(__pyx_v_self->Shape);
3706 __pyx_r = __pyx_v_self->Shape;
3711 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3714 __Pyx_XGIVEREF(__pyx_r);
3715 __Pyx_TraceReturn(__pyx_r, 0);
3716 __Pyx_RefNannyFinishContext();
3721 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3722 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3724 __Pyx_RefNannyDeclarations
3725 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3726 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3729 __Pyx_RefNannyFinishContext();
3733 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3735 __Pyx_TraceDeclarations
3736 __Pyx_RefNannyDeclarations
3737 int __pyx_lineno = 0;
3738 const char *__pyx_filename = NULL;
3739 int __pyx_clineno = 0;
3740 __Pyx_RefNannySetupContext(
"__set__", 0);
3741 __Pyx_TraceCall(
"__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3742 __Pyx_INCREF(__pyx_v_value);
3743 __Pyx_GIVEREF(__pyx_v_value);
3744 __Pyx_GOTREF(__pyx_v_self->Shape);
3745 __Pyx_DECREF(__pyx_v_self->Shape);
3746 __pyx_v_self->Shape = __pyx_v_value;
3752 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3755 __Pyx_TraceReturn(Py_None, 0);
3756 __Pyx_RefNannyFinishContext();
3761 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self);
3762 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3764 __Pyx_RefNannyDeclarations
3765 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3766 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3769 __Pyx_RefNannyFinishContext();
3773 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3775 __Pyx_TraceDeclarations
3776 __Pyx_RefNannyDeclarations
3777 int __pyx_lineno = 0;
3778 const char *__pyx_filename = NULL;
3779 int __pyx_clineno = 0;
3780 __Pyx_RefNannySetupContext(
"__del__", 0);
3781 __Pyx_TraceCall(
"__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3782 __Pyx_INCREF(Py_None);
3783 __Pyx_GIVEREF(Py_None);
3784 __Pyx_GOTREF(__pyx_v_self->Shape);
3785 __Pyx_DECREF(__pyx_v_self->Shape);
3786 __pyx_v_self->Shape = Py_None;
3792 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3795 __Pyx_TraceReturn(Py_None, 0);
3796 __Pyx_RefNannyFinishContext();
3809 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self);
3810 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3811 PyObject *__pyx_r = 0;
3812 __Pyx_RefNannyDeclarations
3813 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3814 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3817 __Pyx_RefNannyFinishContext();
3821 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3822 PyObject *__pyx_r = NULL;
3823 __Pyx_TraceDeclarations
3824 __Pyx_RefNannyDeclarations
3825 int __pyx_lineno = 0;
3826 const char *__pyx_filename = NULL;
3827 int __pyx_clineno = 0;
3828 __Pyx_RefNannySetupContext(
"__get__", 0);
3829 __Pyx_TraceCall(
"__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3830 __Pyx_XDECREF(__pyx_r);
3831 __Pyx_INCREF(__pyx_v_self->name);
3832 __pyx_r = __pyx_v_self->name;
3837 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3840 __Pyx_XGIVEREF(__pyx_r);
3841 __Pyx_TraceReturn(__pyx_r, 0);
3842 __Pyx_RefNannyFinishContext();
3847 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3848 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3850 __Pyx_RefNannyDeclarations
3851 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3852 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3855 __Pyx_RefNannyFinishContext();
3859 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3861 __Pyx_TraceDeclarations
3862 __Pyx_RefNannyDeclarations
3863 PyObject *__pyx_t_1 = NULL;
3864 int __pyx_lineno = 0;
3865 const char *__pyx_filename = NULL;
3866 int __pyx_clineno = 0;
3867 __Pyx_RefNannySetupContext(
"__set__", 0);
3868 __Pyx_TraceCall(
"__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3869 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3870 __pyx_t_1 = __pyx_v_value;
3871 __Pyx_INCREF(__pyx_t_1);
3872 __Pyx_GIVEREF(__pyx_t_1);
3873 __Pyx_GOTREF(__pyx_v_self->name);
3874 __Pyx_DECREF(__pyx_v_self->name);
3875 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3882 __Pyx_XDECREF(__pyx_t_1);
3883 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3886 __Pyx_TraceReturn(Py_None, 0);
3887 __Pyx_RefNannyFinishContext();
3892 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self);
3893 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3895 __Pyx_RefNannyDeclarations
3896 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3897 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3900 __Pyx_RefNannyFinishContext();
3904 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3906 __Pyx_TraceDeclarations
3907 __Pyx_RefNannyDeclarations
3908 int __pyx_lineno = 0;
3909 const char *__pyx_filename = NULL;
3910 int __pyx_clineno = 0;
3911 __Pyx_RefNannySetupContext(
"__del__", 0);
3912 __Pyx_TraceCall(
"__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3913 __Pyx_INCREF(Py_None);
3914 __Pyx_GIVEREF(Py_None);
3915 __Pyx_GOTREF(__pyx_v_self->name);
3916 __Pyx_DECREF(__pyx_v_self->name);
3917 __pyx_v_self->name = ((PyObject*)Py_None);
3923 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3926 __Pyx_TraceReturn(Py_None, 0);
3927 __Pyx_RefNannyFinishContext();
3940 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self);
3941 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3942 PyObject *__pyx_r = 0;
3943 __Pyx_RefNannyDeclarations
3944 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3945 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3948 __Pyx_RefNannyFinishContext();
3952 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3953 PyObject *__pyx_r = NULL;
3954 __Pyx_TraceDeclarations
3955 __Pyx_RefNannyDeclarations
3956 int __pyx_lineno = 0;
3957 const char *__pyx_filename = NULL;
3958 int __pyx_clineno = 0;
3959 __Pyx_RefNannySetupContext(
"__get__", 0);
3960 __Pyx_TraceCall(
"__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3961 __Pyx_XDECREF(__pyx_r);
3962 __Pyx_INCREF(__pyx_v_self->BC_type);
3963 __pyx_r = __pyx_v_self->BC_type;
3968 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3971 __Pyx_XGIVEREF(__pyx_r);
3972 __Pyx_TraceReturn(__pyx_r, 0);
3973 __Pyx_RefNannyFinishContext();
3978 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3979 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3981 __Pyx_RefNannyDeclarations
3982 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3983 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3986 __Pyx_RefNannyFinishContext();
3990 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3992 __Pyx_TraceDeclarations
3993 __Pyx_RefNannyDeclarations
3994 PyObject *__pyx_t_1 = NULL;
3995 int __pyx_lineno = 0;
3996 const char *__pyx_filename = NULL;
3997 int __pyx_clineno = 0;
3998 __Pyx_RefNannySetupContext(
"__set__", 0);
3999 __Pyx_TraceCall(
"__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4000 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
4001 __pyx_t_1 = __pyx_v_value;
4002 __Pyx_INCREF(__pyx_t_1);
4003 __Pyx_GIVEREF(__pyx_t_1);
4004 __Pyx_GOTREF(__pyx_v_self->BC_type);
4005 __Pyx_DECREF(__pyx_v_self->BC_type);
4006 __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
4013 __Pyx_XDECREF(__pyx_t_1);
4014 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4017 __Pyx_TraceReturn(Py_None, 0);
4018 __Pyx_RefNannyFinishContext();
4023 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self);
4024 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
4026 __Pyx_RefNannyDeclarations
4027 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4028 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4031 __Pyx_RefNannyFinishContext();
4035 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4037 __Pyx_TraceDeclarations
4038 __Pyx_RefNannyDeclarations
4039 int __pyx_lineno = 0;
4040 const char *__pyx_filename = NULL;
4041 int __pyx_clineno = 0;
4042 __Pyx_RefNannySetupContext(
"__del__", 0);
4043 __Pyx_TraceCall(
"__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4044 __Pyx_INCREF(Py_None);
4045 __Pyx_GIVEREF(Py_None);
4046 __Pyx_GOTREF(__pyx_v_self->BC_type);
4047 __Pyx_DECREF(__pyx_v_self->BC_type);
4048 __pyx_v_self->BC_type = ((PyObject*)Py_None);
4054 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4057 __Pyx_TraceReturn(Py_None, 0);
4058 __Pyx_RefNannyFinishContext();
4071 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self);
4072 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4073 PyObject *__pyx_r = 0;
4074 __Pyx_RefNannyDeclarations
4075 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4076 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4079 __Pyx_RefNannyFinishContext();
4083 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4084 PyObject *__pyx_r = NULL;
4085 __Pyx_TraceDeclarations
4086 __Pyx_RefNannyDeclarations
4087 int __pyx_lineno = 0;
4088 const char *__pyx_filename = NULL;
4089 int __pyx_clineno = 0;
4090 __Pyx_RefNannySetupContext(
"__get__", 0);
4091 __Pyx_TraceCall(
"__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4092 __Pyx_XDECREF(__pyx_r);
4093 __Pyx_INCREF(__pyx_v_self->ct);
4094 __pyx_r = __pyx_v_self->ct;
4099 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4102 __Pyx_XGIVEREF(__pyx_r);
4103 __Pyx_TraceReturn(__pyx_r, 0);
4104 __Pyx_RefNannyFinishContext();
4109 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4110 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4112 __Pyx_RefNannyDeclarations
4113 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4114 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4117 __Pyx_RefNannyFinishContext();
4121 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4123 __Pyx_TraceDeclarations
4124 __Pyx_RefNannyDeclarations
4125 int __pyx_lineno = 0;
4126 const char *__pyx_filename = NULL;
4127 int __pyx_clineno = 0;
4128 __Pyx_RefNannySetupContext(
"__set__", 0);
4129 __Pyx_TraceCall(
"__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4130 __Pyx_INCREF(__pyx_v_value);
4131 __Pyx_GIVEREF(__pyx_v_value);
4132 __Pyx_GOTREF(__pyx_v_self->ct);
4133 __Pyx_DECREF(__pyx_v_self->ct);
4134 __pyx_v_self->ct = __pyx_v_value;
4140 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4143 __Pyx_TraceReturn(Py_None, 0);
4144 __Pyx_RefNannyFinishContext();
4149 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self);
4150 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4152 __Pyx_RefNannyDeclarations
4153 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4154 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4157 __Pyx_RefNannyFinishContext();
4161 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4163 __Pyx_TraceDeclarations
4164 __Pyx_RefNannyDeclarations
4165 int __pyx_lineno = 0;
4166 const char *__pyx_filename = NULL;
4167 int __pyx_clineno = 0;
4168 __Pyx_RefNannySetupContext(
"__del__", 0);
4169 __Pyx_TraceCall(
"__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4170 __Pyx_INCREF(Py_None);
4171 __Pyx_GIVEREF(Py_None);
4172 __Pyx_GOTREF(__pyx_v_self->ct);
4173 __Pyx_DECREF(__pyx_v_self->ct);
4174 __pyx_v_self->ct = Py_None;
4180 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4183 __Pyx_TraceReturn(Py_None, 0);
4184 __Pyx_RefNannyFinishContext();
4195 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4196 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] =
"BC_Base.__reduce_cython__(self)";
4197 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4198 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4199 PyObject *__pyx_r = 0;
4200 __Pyx_RefNannyDeclarations
4201 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4202 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4205 __Pyx_RefNannyFinishContext();
4209 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4210 PyObject *__pyx_v_state = 0;
4211 PyObject *__pyx_v__dict = 0;
4212 int __pyx_v_use_setstate;
4213 PyObject *__pyx_r = NULL;
4214 __Pyx_TraceDeclarations
4215 __Pyx_RefNannyDeclarations
4216 PyObject *__pyx_t_1 = NULL;
4217 PyObject *__pyx_t_2 = NULL;
4218 PyObject *__pyx_t_3 = NULL;
4222 int __pyx_lineno = 0;
4223 const char *__pyx_filename = NULL;
4224 int __pyx_clineno = 0;
4225 __Pyx_TraceFrameInit(__pyx_codeobj__2)
4226 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4227 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4236 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4237 __Pyx_GOTREF(__pyx_t_1);
4238 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4239 __Pyx_GOTREF(__pyx_t_2);
4240 __pyx_t_3 = PyTuple_New(6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4241 __Pyx_GOTREF(__pyx_t_3);
4242 __Pyx_INCREF(__pyx_v_self->BC_type);
4243 __Pyx_GIVEREF(__pyx_v_self->BC_type);
4244 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4245 __Pyx_INCREF(__pyx_v_self->Shape);
4246 __Pyx_GIVEREF(__pyx_v_self->Shape);
4247 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4248 __Pyx_GIVEREF(__pyx_t_1);
4249 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4250 __Pyx_INCREF(__pyx_v_self->ct);
4251 __Pyx_GIVEREF(__pyx_v_self->ct);
4252 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4253 __Pyx_INCREF(__pyx_v_self->name);
4254 __Pyx_GIVEREF(__pyx_v_self->name);
4255 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4256 __Pyx_GIVEREF(__pyx_t_2);
4257 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4260 __pyx_v_state = ((PyObject*)__pyx_t_3);
4270 __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4271 __Pyx_GOTREF(__pyx_t_3);
4272 __pyx_v__dict = __pyx_t_3;
4282 __pyx_t_4 = (__pyx_v__dict != Py_None);
4283 __pyx_t_5 = (__pyx_t_4 != 0);
4293 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4294 __Pyx_GOTREF(__pyx_t_3);
4295 __Pyx_INCREF(__pyx_v__dict);
4296 __Pyx_GIVEREF(__pyx_v__dict);
4297 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4298 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4299 __Pyx_GOTREF(__pyx_t_2);
4300 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4301 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4311 __pyx_v_use_setstate = 1;
4331 __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4332 __pyx_t_6 = (__pyx_t_4 != 0);
4335 __pyx_t_5 = __pyx_t_6;
4336 goto __pyx_L4_bool_binop_done;
4338 __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4339 __pyx_t_4 = (__pyx_t_6 != 0);
4342 __pyx_t_5 = __pyx_t_4;
4343 goto __pyx_L4_bool_binop_done;
4345 __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4346 __pyx_t_6 = (__pyx_t_4 != 0);
4349 __pyx_t_5 = __pyx_t_6;
4350 goto __pyx_L4_bool_binop_done;
4352 __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4353 __pyx_t_4 = (__pyx_t_6 != 0);
4354 __pyx_t_5 = __pyx_t_4;
4355 __pyx_L4_bool_binop_done:;
4356 __pyx_v_use_setstate = __pyx_t_5;
4367 __pyx_t_5 = (__pyx_v_use_setstate != 0);
4377 __Pyx_XDECREF(__pyx_r);
4378 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4379 __Pyx_GOTREF(__pyx_t_2);
4380 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4381 __Pyx_GOTREF(__pyx_t_3);
4382 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4383 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4384 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4385 __Pyx_INCREF(__pyx_int_158231071);
4386 __Pyx_GIVEREF(__pyx_int_158231071);
4387 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4388 __Pyx_INCREF(Py_None);
4389 __Pyx_GIVEREF(Py_None);
4390 PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4391 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4392 __Pyx_GOTREF(__pyx_t_1);
4393 __Pyx_GIVEREF(__pyx_t_2);
4394 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4395 __Pyx_GIVEREF(__pyx_t_3);
4396 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4397 __Pyx_INCREF(__pyx_v_state);
4398 __Pyx_GIVEREF(__pyx_v_state);
4399 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4402 __pyx_r = __pyx_t_1;
4423 __Pyx_XDECREF(__pyx_r);
4424 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4425 __Pyx_GOTREF(__pyx_t_1);
4426 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4427 __Pyx_GOTREF(__pyx_t_3);
4428 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4429 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4430 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4431 __Pyx_INCREF(__pyx_int_158231071);
4432 __Pyx_GIVEREF(__pyx_int_158231071);
4433 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4434 __Pyx_INCREF(__pyx_v_state);
4435 __Pyx_GIVEREF(__pyx_v_state);
4436 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4437 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4438 __Pyx_GOTREF(__pyx_t_2);
4439 __Pyx_GIVEREF(__pyx_t_1);
4440 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4441 __Pyx_GIVEREF(__pyx_t_3);
4442 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4445 __pyx_r = __pyx_t_2;
4458 __Pyx_XDECREF(__pyx_t_1);
4459 __Pyx_XDECREF(__pyx_t_2);
4460 __Pyx_XDECREF(__pyx_t_3);
4461 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4464 __Pyx_XDECREF(__pyx_v_state);
4465 __Pyx_XDECREF(__pyx_v__dict);
4466 __Pyx_XGIVEREF(__pyx_r);
4467 __Pyx_TraceReturn(__pyx_r, 0);
4468 __Pyx_RefNannyFinishContext();
4480 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4481 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] =
"BC_Base.__setstate_cython__(self, __pyx_state)";
4482 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4483 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4484 PyObject *__pyx_r = 0;
4485 __Pyx_RefNannyDeclarations
4486 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4487 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4490 __Pyx_RefNannyFinishContext();
4494 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4495 PyObject *__pyx_r = NULL;
4496 __Pyx_TraceDeclarations
4497 __Pyx_RefNannyDeclarations
4498 PyObject *__pyx_t_1 = NULL;
4499 int __pyx_lineno = 0;
4500 const char *__pyx_filename = NULL;
4501 int __pyx_clineno = 0;
4502 __Pyx_TraceFrameInit(__pyx_codeobj__3)
4503 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4504 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4511 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4512 __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4513 __Pyx_GOTREF(__pyx_t_1);
4514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4524 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4527 __Pyx_XDECREF(__pyx_t_1);
4528 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4531 __Pyx_XGIVEREF(__pyx_r);
4532 __Pyx_TraceReturn(__pyx_r, 0);
4533 __Pyx_RefNannyFinishContext();
4546 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4547 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4549 __Pyx_RefNannyDeclarations
4550 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4551 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4552 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
4553 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
4554 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4557 __Pyx_RefNannyFinishContext();
4561 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4563 __Pyx_TraceDeclarations
4564 __Pyx_RefNannyDeclarations
4565 int __pyx_lineno = 0;
4566 const char *__pyx_filename = NULL;
4567 int __pyx_clineno = 0;
4568 __Pyx_RefNannySetupContext(
"__init__", 0);
4569 __Pyx_TraceCall(
"__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4578 __Pyx_INCREF(Py_None);
4579 __Pyx_GIVEREF(Py_None);
4580 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4581 __Pyx_DECREF(__pyx_v_self->uOfXT);
4582 __pyx_v_self->uOfXT = Py_None;
4596 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4599 __Pyx_TraceReturn(Py_None, 0);
4600 __Pyx_RefNannyFinishContext();
4613 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4614 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] =
"BoundaryCondition.init_cython(self)";
4615 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4616 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4617 PyObject *__pyx_r = 0;
4618 __Pyx_RefNannyDeclarations
4619 __Pyx_RefNannySetupContext(
"init_cython (wrapper)", 0);
4620 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4623 __Pyx_RefNannyFinishContext();
4627 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4628 PyObject *__pyx_r = NULL;
4629 __Pyx_TraceDeclarations
4630 __Pyx_RefNannyDeclarations
4631 int __pyx_lineno = 0;
4632 const char *__pyx_filename = NULL;
4633 int __pyx_clineno = 0;
4634 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4635 __Pyx_RefNannySetupContext(
"init_cython", 0);
4636 __Pyx_TraceCall(
"init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4645 __Pyx_XDECREF(__pyx_r);
4646 __Pyx_INCREF(__pyx_v_self->uOfXT);
4647 __pyx_r = __pyx_v_self->uOfXT;
4660 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4663 __Pyx_XGIVEREF(__pyx_r);
4664 __Pyx_TraceReturn(__pyx_r, 0);
4665 __Pyx_RefNannyFinishContext();
4677 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4678 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch) {
4679 __Pyx_TraceDeclarations
4680 __Pyx_RefNannyDeclarations
4681 PyObject *__pyx_t_1 = NULL;
4682 PyObject *__pyx_t_2 = NULL;
4683 PyObject *__pyx_t_3 = NULL;
4684 PyObject *__pyx_t_4 = NULL;
4685 int __pyx_lineno = 0;
4686 const char *__pyx_filename = NULL;
4687 int __pyx_clineno = 0;
4688 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4689 __Pyx_RefNannySetupContext(
"resetBC", 0);
4690 __Pyx_TraceCall(
"resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4692 if (unlikely(__pyx_skip_dispatch)) ;
4694 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4695 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4696 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4697 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4698 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4700 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4701 __Pyx_GOTREF(__pyx_t_1);
4702 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4703 __Pyx_INCREF(__pyx_t_1);
4704 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4705 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4706 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4707 if (likely(__pyx_t_4)) {
4708 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4709 __Pyx_INCREF(__pyx_t_4);
4710 __Pyx_INCREF(
function);
4711 __Pyx_DECREF_SET(__pyx_t_3,
function);
4714 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4715 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4716 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4717 __Pyx_GOTREF(__pyx_t_2);
4718 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4719 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4723 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4724 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4725 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4726 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4727 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4731 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4743 __Pyx_INCREF(Py_None);
4744 __Pyx_GIVEREF(Py_None);
4745 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4746 __Pyx_DECREF(__pyx_v_self->uOfXT);
4747 __pyx_v_self->uOfXT = Py_None;
4760 __Pyx_XDECREF(__pyx_t_1);
4761 __Pyx_XDECREF(__pyx_t_2);
4762 __Pyx_XDECREF(__pyx_t_3);
4763 __Pyx_XDECREF(__pyx_t_4);
4764 __Pyx_WriteUnraisable(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4766 __Pyx_TraceReturn(Py_None, 0);
4767 __Pyx_RefNannyFinishContext();
4771 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4772 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] =
"BoundaryCondition.resetBC(self) -> void";
4773 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {
"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4774 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4775 PyObject *__pyx_r = 0;
4776 __Pyx_RefNannyDeclarations
4777 __Pyx_RefNannySetupContext(
"resetBC (wrapper)", 0);
4778 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4781 __Pyx_RefNannyFinishContext();
4785 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4786 PyObject *__pyx_r = NULL;
4787 __Pyx_TraceDeclarations
4788 __Pyx_RefNannyDeclarations
4789 PyObject *__pyx_t_1 = NULL;
4790 int __pyx_lineno = 0;
4791 const char *__pyx_filename = NULL;
4792 int __pyx_clineno = 0;
4793 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4794 __Pyx_RefNannySetupContext(
"resetBC", 0);
4795 __Pyx_TraceCall(
"resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4796 __Pyx_XDECREF(__pyx_r);
4797 __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_1);
4799 __pyx_r = __pyx_t_1;
4805 __Pyx_XDECREF(__pyx_t_1);
4806 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4809 __Pyx_XGIVEREF(__pyx_r);
4810 __Pyx_TraceReturn(__pyx_r, 0);
4811 __Pyx_RefNannyFinishContext();
4824 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4825 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] =
"BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4826 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4827 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4828 PyObject *__pyx_r = 0;
4829 __Pyx_RefNannyDeclarations
4830 __Pyx_RefNannySetupContext(
"setConstantBC (wrapper)", 0);
4831 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4834 __Pyx_RefNannyFinishContext();
4846 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4847 PyObject *__pyx_r = NULL;
4848 __Pyx_TraceDeclarations
4849 __Pyx_RefNannyDeclarations
4850 PyObject *__pyx_t_1 = NULL;
4851 PyObject *__pyx_t_2 = NULL;
4852 int __pyx_lineno = 0;
4853 const char *__pyx_filename = NULL;
4854 int __pyx_clineno = 0;
4855 __Pyx_RefNannySetupContext(
"__defaults__", 0);
4856 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4857 __Pyx_XDECREF(__pyx_r);
4858 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4859 __Pyx_GOTREF(__pyx_t_1);
4860 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4861 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4862 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4863 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4864 __Pyx_GOTREF(__pyx_t_2);
4865 __Pyx_GIVEREF(__pyx_t_1);
4866 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4867 __Pyx_INCREF(Py_None);
4868 __Pyx_GIVEREF(Py_None);
4869 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4871 __pyx_r = __pyx_t_2;
4877 __Pyx_XDECREF(__pyx_t_1);
4878 __Pyx_XDECREF(__pyx_t_2);
4879 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4882 __Pyx_XGIVEREF(__pyx_r);
4883 __Pyx_TraceReturn(__pyx_r, 0);
4884 __Pyx_RefNannyFinishContext();
4889 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4890 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {
"lambda", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4891 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4892 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4893 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4894 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
4895 int __pyx_lineno = 0;
4896 const char *__pyx_filename = NULL;
4897 int __pyx_clineno = 0;
4898 PyObject *__pyx_r = 0;
4899 __Pyx_RefNannyDeclarations
4900 __Pyx_RefNannySetupContext(
"lambda (wrapper)", 0);
4902 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
4903 PyObject* values[3] = {0,0,0};
4904 __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
4905 values[2] = __pyx_dynamic_args->__pyx_arg_n;
4906 if (unlikely(__pyx_kwds)) {
4908 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4910 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4912 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4914 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4917 default:
goto __pyx_L5_argtuple_error;
4919 kw_args = PyDict_Size(__pyx_kwds);
4922 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4923 else goto __pyx_L5_argtuple_error;
4926 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4928 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
4933 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
4934 if (value) { values[2] = value; kw_args--; }
4937 if (unlikely(kw_args > 0)) {
4938 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
4941 switch (PyTuple_GET_SIZE(__pyx_args)) {
4942 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4944 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4945 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4947 default:
goto __pyx_L5_argtuple_error;
4950 __pyx_v_x = values[0];
4951 __pyx_v_t = values[1];
4952 __pyx_v_n = values[2];
4954 goto __pyx_L4_argument_unpacking_done;
4955 __pyx_L5_argtuple_error:;
4956 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
4958 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4959 __Pyx_RefNannyFinishContext();
4961 __pyx_L4_argument_unpacking_done:;
4962 __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
4965 __Pyx_RefNannyFinishContext();
4969 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
4970 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4971 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4972 PyObject *__pyx_r = NULL;
4973 __Pyx_TraceDeclarations
4974 __Pyx_RefNannyDeclarations
4975 int __pyx_lineno = 0;
4976 const char *__pyx_filename = NULL;
4977 int __pyx_clineno = 0;
4978 __Pyx_RefNannySetupContext(
"lambda", 0);
4979 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4980 __pyx_cur_scope = __pyx_outer_scope;
4981 __Pyx_TraceCall(
"lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4982 __Pyx_XDECREF(__pyx_r);
4983 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 97, __pyx_L1_error) }
4984 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4985 __pyx_r = __pyx_cur_scope->__pyx_v_value;
4990 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4993 __Pyx_XGIVEREF(__pyx_r);
4994 __Pyx_TraceReturn(__pyx_r, 0);
4995 __Pyx_RefNannyFinishContext();
5007 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5008 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5009 PyObject *__pyx_r = NULL;
5010 __Pyx_TraceDeclarations
5011 __Pyx_RefNannyDeclarations
5012 PyObject *__pyx_t_1 = NULL;
5013 PyObject *__pyx_t_2 = NULL;
5014 PyObject *__pyx_t_3 = NULL;
5015 PyObject *__pyx_t_4 = NULL;
5016 int __pyx_lineno = 0;
5017 const char *__pyx_filename = NULL;
5018 int __pyx_clineno = 0;
5019 __Pyx_TraceFrameInit(__pyx_codeobj__6)
5020 __Pyx_RefNannySetupContext(
"setConstantBC", 0);
5021 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
5022 if (unlikely(!__pyx_cur_scope)) {
5023 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
5024 __Pyx_INCREF(Py_None);
5025 __PYX_ERR(0, 87, __pyx_L1_error)
5027 __Pyx_GOTREF(__pyx_cur_scope);
5029 __Pyx_TraceCall(
"setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
5030 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5031 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5032 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5041 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5042 __Pyx_GOTREF(__pyx_t_1);
5043 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
5044 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
5045 __Pyx_GOTREF(__pyx_t_3);
5046 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5047 __Pyx_GOTREF(__pyx_t_4);
5048 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5050 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5051 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5052 if (likely(__pyx_t_3)) {
5053 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5054 __Pyx_INCREF(__pyx_t_3);
5055 __Pyx_INCREF(
function);
5056 __Pyx_DECREF_SET(__pyx_t_4,
function);
5059 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5060 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5061 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
5062 __Pyx_GOTREF(__pyx_t_2);
5063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5064 __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5065 __Pyx_GIVEREF(__pyx_t_2);
5067 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
5068 __Pyx_GIVEREF(__pyx_t_1);
5069 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5070 __Pyx_DECREF(__pyx_v_self->uOfXT);
5071 __pyx_v_self->uOfXT = __pyx_t_1;
5083 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5086 __Pyx_XDECREF(__pyx_t_1);
5087 __Pyx_XDECREF(__pyx_t_2);
5088 __Pyx_XDECREF(__pyx_t_3);
5089 __Pyx_XDECREF(__pyx_t_4);
5090 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5093 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5094 __Pyx_XGIVEREF(__pyx_r);
5095 __Pyx_TraceReturn(__pyx_r, 0);
5096 __Pyx_RefNannyFinishContext();
5109 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5110 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] =
"BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5111 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5112 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5113 PyObject *__pyx_v_a0 = 0;
5114 PyObject *__pyx_v_a = 0;
5115 int __pyx_lineno = 0;
5116 const char *__pyx_filename = NULL;
5117 int __pyx_clineno = 0;
5118 PyObject *__pyx_r = 0;
5119 __Pyx_RefNannyDeclarations
5120 __Pyx_RefNannySetupContext(
"setLinearBC (wrapper)", 0);
5122 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5123 PyObject* values[2] = {0,0};
5124 if (unlikely(__pyx_kwds)) {
5126 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5128 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5130 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5133 default:
goto __pyx_L5_argtuple_error;
5135 kw_args = PyDict_Size(__pyx_kwds);
5138 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5139 else goto __pyx_L5_argtuple_error;
5142 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5144 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5147 if (unlikely(kw_args > 0)) {
5148 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5150 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5151 goto __pyx_L5_argtuple_error;
5153 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5154 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5156 __pyx_v_a0 = values[0];
5157 __pyx_v_a = values[1];
5159 goto __pyx_L4_argument_unpacking_done;
5160 __pyx_L5_argtuple_error:;
5161 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5163 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5164 __Pyx_RefNannyFinishContext();
5166 __pyx_L4_argument_unpacking_done:;
5167 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5170 __Pyx_RefNannyFinishContext();
5182 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5183 PyObject *__pyx_r = NULL;
5184 __Pyx_TraceDeclarations
5185 __Pyx_RefNannyDeclarations
5186 PyObject *__pyx_t_1 = NULL;
5187 PyObject *__pyx_t_2 = NULL;
5188 int __pyx_lineno = 0;
5189 const char *__pyx_filename = NULL;
5190 int __pyx_clineno = 0;
5191 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5192 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5193 __Pyx_XDECREF(__pyx_r);
5194 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5195 __Pyx_GOTREF(__pyx_t_1);
5196 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5197 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5198 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5199 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5200 __Pyx_GOTREF(__pyx_t_2);
5201 __Pyx_GIVEREF(__pyx_t_1);
5202 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5203 __Pyx_INCREF(Py_None);
5204 __Pyx_GIVEREF(Py_None);
5205 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5207 __pyx_r = __pyx_t_2;
5213 __Pyx_XDECREF(__pyx_t_1);
5214 __Pyx_XDECREF(__pyx_t_2);
5215 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5218 __Pyx_XGIVEREF(__pyx_r);
5219 __Pyx_TraceReturn(__pyx_r, 0);
5220 __Pyx_RefNannyFinishContext();
5225 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5226 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {
"lambda1", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5227 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5228 PyObject *__pyx_v_x = 0;
5229 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5230 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5231 int __pyx_lineno = 0;
5232 const char *__pyx_filename = NULL;
5233 int __pyx_clineno = 0;
5234 PyObject *__pyx_r = 0;
5235 __Pyx_RefNannyDeclarations
5236 __Pyx_RefNannySetupContext(
"lambda1 (wrapper)", 0);
5238 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5239 PyObject* values[3] = {0,0,0};
5240 __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5241 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5242 if (unlikely(__pyx_kwds)) {
5244 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5246 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5248 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5250 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5253 default:
goto __pyx_L5_argtuple_error;
5255 kw_args = PyDict_Size(__pyx_kwds);
5258 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5259 else goto __pyx_L5_argtuple_error;
5262 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5264 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5269 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5270 if (value) { values[2] = value; kw_args--; }
5273 if (unlikely(kw_args > 0)) {
5274 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5277 switch (PyTuple_GET_SIZE(__pyx_args)) {
5278 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5280 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5281 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5283 default:
goto __pyx_L5_argtuple_error;
5286 __pyx_v_x = values[0];
5287 __pyx_v_t = values[1];
5288 __pyx_v_n = values[2];
5290 goto __pyx_L4_argument_unpacking_done;
5291 __pyx_L5_argtuple_error:;
5292 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5294 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5295 __Pyx_RefNannyFinishContext();
5297 __pyx_L4_argument_unpacking_done:;
5298 __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5301 __Pyx_RefNannyFinishContext();
5305 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5306 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5307 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5308 PyObject *__pyx_r = NULL;
5309 __Pyx_TraceDeclarations
5310 __Pyx_RefNannyDeclarations
5311 PyObject *__pyx_t_1 = NULL;
5312 PyObject *__pyx_t_2 = NULL;
5313 PyObject *__pyx_t_3 = NULL;
5314 int __pyx_lineno = 0;
5315 const char *__pyx_filename = NULL;
5316 int __pyx_clineno = 0;
5317 __Pyx_RefNannySetupContext(
"lambda1", 0);
5318 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5319 __pyx_cur_scope = __pyx_outer_scope;
5320 __Pyx_TraceCall(
"lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5321 __Pyx_XDECREF(__pyx_r);
5322 if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError(
"a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5323 if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError(
"a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5324 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5325 __Pyx_GOTREF(__pyx_t_1);
5326 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5327 __Pyx_GOTREF(__pyx_t_2);
5328 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5329 __Pyx_GOTREF(__pyx_t_3);
5330 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5331 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5332 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5333 __Pyx_GOTREF(__pyx_t_2);
5334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5335 __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5336 __Pyx_GOTREF(__pyx_t_3);
5337 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5338 __pyx_r = __pyx_t_3;
5344 __Pyx_XDECREF(__pyx_t_1);
5345 __Pyx_XDECREF(__pyx_t_2);
5346 __Pyx_XDECREF(__pyx_t_3);
5347 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5350 __Pyx_XGIVEREF(__pyx_r);
5351 __Pyx_TraceReturn(__pyx_r, 0);
5352 __Pyx_RefNannyFinishContext();
5364 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5365 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5366 PyObject *__pyx_r = NULL;
5367 __Pyx_TraceDeclarations
5368 __Pyx_RefNannyDeclarations
5369 PyObject *__pyx_t_1 = NULL;
5370 PyObject *__pyx_t_2 = NULL;
5371 PyObject *__pyx_t_3 = NULL;
5372 PyObject *__pyx_t_4 = NULL;
5373 int __pyx_lineno = 0;
5374 const char *__pyx_filename = NULL;
5375 int __pyx_clineno = 0;
5376 __Pyx_TraceFrameInit(__pyx_codeobj__8)
5377 __Pyx_RefNannySetupContext(
"setLinearBC", 0);
5378 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5379 if (unlikely(!__pyx_cur_scope)) {
5380 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5381 __Pyx_INCREF(Py_None);
5382 __PYX_ERR(0, 100, __pyx_L1_error)
5384 __Pyx_GOTREF(__pyx_cur_scope);
5386 __Pyx_TraceCall(
"setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5387 __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5388 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5389 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5390 __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5391 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5392 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5401 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5402 __Pyx_GOTREF(__pyx_t_1);
5403 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5404 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5405 __Pyx_GOTREF(__pyx_t_3);
5406 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5407 __Pyx_GOTREF(__pyx_t_4);
5408 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5410 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5411 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5412 if (likely(__pyx_t_3)) {
5413 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5414 __Pyx_INCREF(__pyx_t_3);
5415 __Pyx_INCREF(
function);
5416 __Pyx_DECREF_SET(__pyx_t_4,
function);
5419 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5420 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5421 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5422 __Pyx_GOTREF(__pyx_t_2);
5423 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5424 __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5425 __Pyx_GIVEREF(__pyx_t_2);
5427 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5428 __Pyx_GIVEREF(__pyx_t_1);
5429 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5430 __Pyx_DECREF(__pyx_v_self->uOfXT);
5431 __pyx_v_self->uOfXT = __pyx_t_1;
5443 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5446 __Pyx_XDECREF(__pyx_t_1);
5447 __Pyx_XDECREF(__pyx_t_2);
5448 __Pyx_XDECREF(__pyx_t_3);
5449 __Pyx_XDECREF(__pyx_t_4);
5450 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5453 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5454 __Pyx_XGIVEREF(__pyx_r);
5455 __Pyx_TraceReturn(__pyx_r, 0);
5456 __Pyx_RefNannyFinishContext();
5469 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5470 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] =
"BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5471 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5472 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5473 PyObject *__pyx_v_t1 = 0;
5474 PyObject *__pyx_v_value = 0;
5475 int __pyx_lineno = 0;
5476 const char *__pyx_filename = NULL;
5477 int __pyx_clineno = 0;
5478 PyObject *__pyx_r = 0;
5479 __Pyx_RefNannyDeclarations
5480 __Pyx_RefNannySetupContext(
"setLinearRamp (wrapper)", 0);
5482 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5483 PyObject* values[2] = {0,0};
5484 if (unlikely(__pyx_kwds)) {
5486 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5488 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5490 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5493 default:
goto __pyx_L5_argtuple_error;
5495 kw_args = PyDict_Size(__pyx_kwds);
5498 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5499 else goto __pyx_L5_argtuple_error;
5502 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5504 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5507 if (unlikely(kw_args > 0)) {
5508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5510 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5511 goto __pyx_L5_argtuple_error;
5513 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5514 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5516 __pyx_v_t1 = values[0];
5517 __pyx_v_value = values[1];
5519 goto __pyx_L4_argument_unpacking_done;
5520 __pyx_L5_argtuple_error:;
5521 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5523 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5524 __Pyx_RefNannyFinishContext();
5526 __pyx_L4_argument_unpacking_done:;
5527 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5530 __Pyx_RefNannyFinishContext();
5540 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5541 PyObject *__pyx_r = NULL;
5542 __Pyx_TraceDeclarations
5543 __Pyx_RefNannyDeclarations
5544 PyObject *__pyx_t_1 = NULL;
5545 PyObject *__pyx_t_2 = NULL;
5546 int __pyx_lineno = 0;
5547 const char *__pyx_filename = NULL;
5548 int __pyx_clineno = 0;
5549 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5550 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5551 __Pyx_XDECREF(__pyx_r);
5552 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5553 __Pyx_GOTREF(__pyx_t_1);
5554 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5555 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5556 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5557 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5558 __Pyx_GOTREF(__pyx_t_2);
5559 __Pyx_GIVEREF(__pyx_t_1);
5560 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5561 __Pyx_INCREF(Py_None);
5562 __Pyx_GIVEREF(Py_None);
5563 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5565 __pyx_r = __pyx_t_2;
5571 __Pyx_XDECREF(__pyx_t_1);
5572 __Pyx_XDECREF(__pyx_t_2);
5573 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5576 __Pyx_XGIVEREF(__pyx_r);
5577 __Pyx_TraceReturn(__pyx_r, 0);
5578 __Pyx_RefNannyFinishContext();
5583 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5584 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {
"lambda2", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5585 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5586 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5587 PyObject *__pyx_v_t = 0;
5588 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5589 int __pyx_lineno = 0;
5590 const char *__pyx_filename = NULL;
5591 int __pyx_clineno = 0;
5592 PyObject *__pyx_r = 0;
5593 __Pyx_RefNannyDeclarations
5594 __Pyx_RefNannySetupContext(
"lambda2 (wrapper)", 0);
5596 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5597 PyObject* values[3] = {0,0,0};
5598 __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5599 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5600 if (unlikely(__pyx_kwds)) {
5602 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5604 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5606 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5608 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5611 default:
goto __pyx_L5_argtuple_error;
5613 kw_args = PyDict_Size(__pyx_kwds);
5616 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5617 else goto __pyx_L5_argtuple_error;
5620 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5622 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5627 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5628 if (value) { values[2] = value; kw_args--; }
5631 if (unlikely(kw_args > 0)) {
5632 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5635 switch (PyTuple_GET_SIZE(__pyx_args)) {
5636 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5638 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5639 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5641 default:
goto __pyx_L5_argtuple_error;
5644 __pyx_v_x = values[0];
5645 __pyx_v_t = values[1];
5646 __pyx_v_n = values[2];
5648 goto __pyx_L4_argument_unpacking_done;
5649 __pyx_L5_argtuple_error:;
5650 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5652 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5653 __Pyx_RefNannyFinishContext();
5655 __pyx_L4_argument_unpacking_done:;
5656 __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5659 __Pyx_RefNannyFinishContext();
5663 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5664 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5665 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5666 PyObject *__pyx_r = NULL;
5667 __Pyx_TraceDeclarations
5668 __Pyx_RefNannyDeclarations
5670 PyObject *__pyx_t_2 = NULL;
5671 PyObject *__pyx_t_3 = NULL;
5672 PyObject *__pyx_t_4 = NULL;
5673 PyObject *__pyx_t_5 = NULL;
5675 int __pyx_lineno = 0;
5676 const char *__pyx_filename = NULL;
5677 int __pyx_clineno = 0;
5678 __Pyx_RefNannySetupContext(
"lambda2", 0);
5679 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5680 __pyx_cur_scope = __pyx_outer_scope;
5681 __Pyx_TraceCall(
"lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5682 __Pyx_XDECREF(__pyx_r);
5684 if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError(
"t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5685 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5686 __Pyx_GOTREF(__pyx_t_2);
5687 __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5688 __Pyx_GOTREF(__pyx_t_4);
5689 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5690 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5691 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5692 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5694 __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5695 __Pyx_GOTREF(__pyx_t_5);
5696 __pyx_t_3 = __pyx_t_5;
5699 __Pyx_INCREF(__pyx_t_2);
5700 __pyx_t_3 = __pyx_t_2;
5702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5703 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5704 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5705 __Pyx_GOTREF(__pyx_t_2);
5706 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5707 __pyx_r = __pyx_t_2;
5713 __Pyx_XDECREF(__pyx_t_2);
5714 __Pyx_XDECREF(__pyx_t_3);
5715 __Pyx_XDECREF(__pyx_t_4);
5716 __Pyx_XDECREF(__pyx_t_5);
5717 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5720 __Pyx_XGIVEREF(__pyx_r);
5721 __Pyx_TraceReturn(__pyx_r, 0);
5722 __Pyx_RefNannyFinishContext();
5734 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5735 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5736 PyObject *__pyx_r = NULL;
5737 __Pyx_TraceDeclarations
5738 __Pyx_RefNannyDeclarations
5739 PyObject *__pyx_t_1 = NULL;
5740 PyObject *__pyx_t_2 = NULL;
5741 PyObject *__pyx_t_3 = NULL;
5742 PyObject *__pyx_t_4 = NULL;
5743 int __pyx_lineno = 0;
5744 const char *__pyx_filename = NULL;
5745 int __pyx_clineno = 0;
5746 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5747 __Pyx_RefNannySetupContext(
"setLinearRamp", 0);
5748 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5749 if (unlikely(!__pyx_cur_scope)) {
5750 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5751 __Pyx_INCREF(Py_None);
5752 __PYX_ERR(0, 115, __pyx_L1_error)
5754 __Pyx_GOTREF(__pyx_cur_scope);
5756 __Pyx_TraceCall(
"setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5757 __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5758 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5759 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5760 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5761 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5762 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5769 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5770 __Pyx_GOTREF(__pyx_t_1);
5771 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5772 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5773 __Pyx_GOTREF(__pyx_t_3);
5774 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5775 __Pyx_GOTREF(__pyx_t_4);
5776 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5778 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5779 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5780 if (likely(__pyx_t_3)) {
5781 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5782 __Pyx_INCREF(__pyx_t_3);
5783 __Pyx_INCREF(
function);
5784 __Pyx_DECREF_SET(__pyx_t_4,
function);
5787 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5788 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5789 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5790 __Pyx_GOTREF(__pyx_t_2);
5791 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5792 __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5793 __Pyx_GIVEREF(__pyx_t_2);
5795 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5796 __Pyx_GIVEREF(__pyx_t_1);
5797 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5798 __Pyx_DECREF(__pyx_v_self->uOfXT);
5799 __pyx_v_self->uOfXT = __pyx_t_1;
5811 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5814 __Pyx_XDECREF(__pyx_t_1);
5815 __Pyx_XDECREF(__pyx_t_2);
5816 __Pyx_XDECREF(__pyx_t_3);
5817 __Pyx_XDECREF(__pyx_t_4);
5818 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5821 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5822 __Pyx_XGIVEREF(__pyx_r);
5823 __Pyx_TraceReturn(__pyx_r, 0);
5824 __Pyx_RefNannyFinishContext();
5837 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self);
5838 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5839 PyObject *__pyx_r = 0;
5840 __Pyx_RefNannyDeclarations
5841 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5842 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5845 __Pyx_RefNannyFinishContext();
5849 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5850 PyObject *__pyx_r = NULL;
5851 __Pyx_TraceDeclarations
5852 __Pyx_RefNannyDeclarations
5853 int __pyx_lineno = 0;
5854 const char *__pyx_filename = NULL;
5855 int __pyx_clineno = 0;
5856 __Pyx_RefNannySetupContext(
"__get__", 0);
5857 __Pyx_TraceCall(
"__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5858 __Pyx_XDECREF(__pyx_r);
5859 __Pyx_INCREF(__pyx_v_self->uOfXT);
5860 __pyx_r = __pyx_v_self->uOfXT;
5865 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5868 __Pyx_XGIVEREF(__pyx_r);
5869 __Pyx_TraceReturn(__pyx_r, 0);
5870 __Pyx_RefNannyFinishContext();
5875 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
5876 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5878 __Pyx_RefNannyDeclarations
5879 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
5880 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5883 __Pyx_RefNannyFinishContext();
5887 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5889 __Pyx_TraceDeclarations
5890 __Pyx_RefNannyDeclarations
5891 int __pyx_lineno = 0;
5892 const char *__pyx_filename = NULL;
5893 int __pyx_clineno = 0;
5894 __Pyx_RefNannySetupContext(
"__set__", 0);
5895 __Pyx_TraceCall(
"__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5896 __Pyx_INCREF(__pyx_v_value);
5897 __Pyx_GIVEREF(__pyx_v_value);
5898 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5899 __Pyx_DECREF(__pyx_v_self->uOfXT);
5900 __pyx_v_self->uOfXT = __pyx_v_value;
5906 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5909 __Pyx_TraceReturn(Py_None, 0);
5910 __Pyx_RefNannyFinishContext();
5915 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self);
5916 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5918 __Pyx_RefNannyDeclarations
5919 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
5920 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5923 __Pyx_RefNannyFinishContext();
5927 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5929 __Pyx_TraceDeclarations
5930 __Pyx_RefNannyDeclarations
5931 int __pyx_lineno = 0;
5932 const char *__pyx_filename = NULL;
5933 int __pyx_clineno = 0;
5934 __Pyx_RefNannySetupContext(
"__del__", 0);
5935 __Pyx_TraceCall(
"__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5936 __Pyx_INCREF(Py_None);
5937 __Pyx_GIVEREF(Py_None);
5938 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5939 __Pyx_DECREF(__pyx_v_self->uOfXT);
5940 __pyx_v_self->uOfXT = Py_None;
5946 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5949 __Pyx_TraceReturn(Py_None, 0);
5950 __Pyx_RefNannyFinishContext();
5961 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5962 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] =
"BoundaryCondition.__reduce_cython__(self)";
5963 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
5964 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5965 PyObject *__pyx_r = 0;
5966 __Pyx_RefNannyDeclarations
5967 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5968 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5971 __Pyx_RefNannyFinishContext();
5975 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5976 PyObject *__pyx_r = NULL;
5977 __Pyx_TraceDeclarations
5978 __Pyx_RefNannyDeclarations
5979 PyObject *__pyx_t_1 = NULL;
5980 int __pyx_lineno = 0;
5981 const char *__pyx_filename = NULL;
5982 int __pyx_clineno = 0;
5983 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5984 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5985 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
5993 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5994 __Pyx_GOTREF(__pyx_t_1);
5995 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5997 __PYX_ERR(1, 2, __pyx_L1_error)
6007 __Pyx_XDECREF(__pyx_t_1);
6008 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6010 __Pyx_XGIVEREF(__pyx_r);
6011 __Pyx_TraceReturn(__pyx_r, 0);
6012 __Pyx_RefNannyFinishContext();
6024 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6025 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] =
"BoundaryCondition.__setstate_cython__(self, __pyx_state)";
6026 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
6027 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6028 PyObject *__pyx_r = 0;
6029 __Pyx_RefNannyDeclarations
6030 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6031 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6034 __Pyx_RefNannyFinishContext();
6038 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6039 PyObject *__pyx_r = NULL;
6040 __Pyx_TraceDeclarations
6041 __Pyx_RefNannyDeclarations
6042 PyObject *__pyx_t_1 = NULL;
6043 int __pyx_lineno = 0;
6044 const char *__pyx_filename = NULL;
6045 int __pyx_clineno = 0;
6046 __Pyx_TraceFrameInit(__pyx_codeobj__12)
6047 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6048 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6055 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6056 __Pyx_GOTREF(__pyx_t_1);
6057 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6059 __PYX_ERR(1, 4, __pyx_L1_error)
6070 __Pyx_XDECREF(__pyx_t_1);
6071 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6073 __Pyx_XGIVEREF(__pyx_r);
6074 __Pyx_TraceReturn(__pyx_r, 0);
6075 __Pyx_RefNannyFinishContext();
6086 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6087 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
6088 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {
"__pyx_unpickle_BC_Base", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
6089 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6090 PyObject *__pyx_v___pyx_type = 0;
6091 long __pyx_v___pyx_checksum;
6092 PyObject *__pyx_v___pyx_state = 0;
6093 int __pyx_lineno = 0;
6094 const char *__pyx_filename = NULL;
6095 int __pyx_clineno = 0;
6096 PyObject *__pyx_r = 0;
6097 __Pyx_RefNannyDeclarations
6098 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base (wrapper)", 0);
6100 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6101 PyObject* values[3] = {0,0,0};
6102 if (unlikely(__pyx_kwds)) {
6104 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6106 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6108 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6110 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6113 default:
goto __pyx_L5_argtuple_error;
6115 kw_args = PyDict_Size(__pyx_kwds);
6118 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6119 else goto __pyx_L5_argtuple_error;
6122 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6124 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6128 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6130 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6133 if (unlikely(kw_args > 0)) {
6134 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6136 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6137 goto __pyx_L5_argtuple_error;
6139 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6140 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6141 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6143 __pyx_v___pyx_type = values[0];
6144 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
6145 __pyx_v___pyx_state = values[2];
6147 goto __pyx_L4_argument_unpacking_done;
6148 __pyx_L5_argtuple_error:;
6149 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6151 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6152 __Pyx_RefNannyFinishContext();
6154 __pyx_L4_argument_unpacking_done:;
6155 __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6158 __Pyx_RefNannyFinishContext();
6162 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6163 PyObject *__pyx_v___pyx_PickleError = 0;
6164 PyObject *__pyx_v___pyx_result = 0;
6165 PyObject *__pyx_r = NULL;
6166 __Pyx_TraceDeclarations
6167 __Pyx_RefNannyDeclarations
6169 PyObject *__pyx_t_2 = NULL;
6170 PyObject *__pyx_t_3 = NULL;
6171 PyObject *__pyx_t_4 = NULL;
6172 PyObject *__pyx_t_5 = NULL;
6174 int __pyx_lineno = 0;
6175 const char *__pyx_filename = NULL;
6176 int __pyx_clineno = 0;
6177 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6178 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base", 0);
6179 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6188 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
6198 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6199 __Pyx_GOTREF(__pyx_t_2);
6200 __Pyx_INCREF(__pyx_n_s_PickleError);
6201 __Pyx_GIVEREF(__pyx_n_s_PickleError);
6202 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6203 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6204 __Pyx_GOTREF(__pyx_t_3);
6205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6206 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6207 __Pyx_GOTREF(__pyx_t_2);
6208 __Pyx_INCREF(__pyx_t_2);
6209 __pyx_v___pyx_PickleError = __pyx_t_2;
6210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6220 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6221 __Pyx_GOTREF(__pyx_t_2);
6222 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6223 __Pyx_GOTREF(__pyx_t_4);
6224 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6225 __Pyx_INCREF(__pyx_v___pyx_PickleError);
6226 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6227 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6228 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6229 if (likely(__pyx_t_5)) {
6230 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6231 __Pyx_INCREF(__pyx_t_5);
6232 __Pyx_INCREF(
function);
6233 __Pyx_DECREF_SET(__pyx_t_2,
function);
6236 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6237 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6238 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6239 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6240 __Pyx_GOTREF(__pyx_t_3);
6241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6242 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6243 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6244 __PYX_ERR(1, 6, __pyx_L1_error)
6262 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6263 __Pyx_GOTREF(__pyx_t_2);
6265 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6266 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6267 if (likely(__pyx_t_4)) {
6268 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6269 __Pyx_INCREF(__pyx_t_4);
6270 __Pyx_INCREF(
function);
6271 __Pyx_DECREF_SET(__pyx_t_2,
function);
6274 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6275 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6276 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6277 __Pyx_GOTREF(__pyx_t_3);
6278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6279 __pyx_v___pyx_result = __pyx_t_3;
6289 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6290 __pyx_t_6 = (__pyx_t_1 != 0);
6300 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6301 __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6302 __Pyx_GOTREF(__pyx_t_3);
6303 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6321 __Pyx_XDECREF(__pyx_r);
6322 __Pyx_INCREF(__pyx_v___pyx_result);
6323 __pyx_r = __pyx_v___pyx_result;
6334 __Pyx_XDECREF(__pyx_t_2);
6335 __Pyx_XDECREF(__pyx_t_3);
6336 __Pyx_XDECREF(__pyx_t_4);
6337 __Pyx_XDECREF(__pyx_t_5);
6338 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6341 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6342 __Pyx_XDECREF(__pyx_v___pyx_result);
6343 __Pyx_XGIVEREF(__pyx_r);
6344 __Pyx_TraceReturn(__pyx_r, 0);
6345 __Pyx_RefNannyFinishContext();
6357 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6358 PyObject *__pyx_r = NULL;
6359 __Pyx_TraceDeclarations
6360 __Pyx_RefNannyDeclarations
6361 PyObject *__pyx_t_1 = NULL;
6362 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6365 Py_ssize_t __pyx_t_5;
6368 PyObject *__pyx_t_8 = NULL;
6369 PyObject *__pyx_t_9 = NULL;
6370 int __pyx_lineno = 0;
6371 const char *__pyx_filename = NULL;
6372 int __pyx_clineno = 0;
6373 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base__set_state", 0);
6374 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6383 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6384 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6385 __PYX_ERR(1, 12, __pyx_L1_error)
6387 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6388 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6389 __Pyx_INCREF(__pyx_t_1);
6390 __Pyx_GIVEREF(__pyx_t_1);
6391 __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6392 __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6393 __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6395 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6396 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6397 __PYX_ERR(1, 12, __pyx_L1_error)
6399 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6400 __Pyx_INCREF(__pyx_t_1);
6401 __Pyx_GIVEREF(__pyx_t_1);
6402 __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6403 __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6404 __pyx_v___pyx_result->Shape = __pyx_t_1;
6406 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6407 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6408 __PYX_ERR(1, 12, __pyx_L1_error)
6410 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6411 __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6412 __pyx_v___pyx_result->_b_or = __pyx_t_2;
6413 __pyx_t_2.memview = NULL;
6414 __pyx_t_2.data = NULL;
6415 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6416 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6417 __PYX_ERR(1, 12, __pyx_L1_error)
6419 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6420 __Pyx_INCREF(__pyx_t_1);
6421 __Pyx_GIVEREF(__pyx_t_1);
6422 __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6423 __Pyx_DECREF(__pyx_v___pyx_result->ct);
6424 __pyx_v___pyx_result->ct = __pyx_t_1;
6426 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6427 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6428 __PYX_ERR(1, 12, __pyx_L1_error)
6430 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6431 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6432 __Pyx_INCREF(__pyx_t_1);
6433 __Pyx_GIVEREF(__pyx_t_1);
6434 __Pyx_GOTREF(__pyx_v___pyx_result->name);
6435 __Pyx_DECREF(__pyx_v___pyx_result->name);
6436 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6438 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6439 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6440 __PYX_ERR(1, 12, __pyx_L1_error)
6442 __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5));
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6443 __pyx_v___pyx_result->nd = __pyx_t_3;
6451 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6452 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6453 __PYX_ERR(1, 13, __pyx_L1_error)
6455 __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6456 __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6459 __pyx_t_4 = __pyx_t_6;
6460 goto __pyx_L4_bool_binop_done;
6462 __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6463 __pyx_t_7 = (__pyx_t_6 != 0);
6464 __pyx_t_4 = __pyx_t_7;
6465 __pyx_L4_bool_binop_done:;
6473 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6474 __Pyx_GOTREF(__pyx_t_8);
6475 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6476 __Pyx_GOTREF(__pyx_t_9);
6477 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6478 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6479 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6480 __PYX_ERR(1, 14, __pyx_L1_error)
6483 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6484 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6485 if (likely(__pyx_t_8)) {
6486 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
6487 __Pyx_INCREF(__pyx_t_8);
6488 __Pyx_INCREF(
function);
6489 __Pyx_DECREF_SET(__pyx_t_9,
function);
6492 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6493 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6494 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6495 __Pyx_GOTREF(__pyx_t_1);
6496 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6516 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6519 __Pyx_XDECREF(__pyx_t_1);
6520 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6521 __Pyx_XDECREF(__pyx_t_8);
6522 __Pyx_XDECREF(__pyx_t_9);
6523 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6526 __Pyx_XGIVEREF(__pyx_r);
6527 __Pyx_TraceReturn(__pyx_r, 0);
6528 __Pyx_RefNannyFinishContext();
6540 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6541 PyObject *__pyx_r = NULL;
6542 __Pyx_TraceDeclarations
6543 __Pyx_RefNannyDeclarations
6544 PyObject *__pyx_t_1 = NULL;
6545 int __pyx_lineno = 0;
6546 const char *__pyx_filename = NULL;
6547 int __pyx_clineno = 0;
6548 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6549 __Pyx_TraceCall(
"PyArray_MultiIterNew1", __pyx_f[3], 742, 0, __PYX_ERR(3, 742, __pyx_L1_error));
6558 __Pyx_XDECREF(__pyx_r);
6559 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 743, __pyx_L1_error)
6560 __Pyx_GOTREF(__pyx_t_1);
6561 __pyx_r = __pyx_t_1;
6575 __Pyx_XDECREF(__pyx_t_1);
6576 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6579 __Pyx_XGIVEREF(__pyx_r);
6580 __Pyx_TraceReturn(__pyx_r, 0);
6581 __Pyx_RefNannyFinishContext();
6593 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6594 PyObject *__pyx_r = NULL;
6595 __Pyx_TraceDeclarations
6596 __Pyx_RefNannyDeclarations
6597 PyObject *__pyx_t_1 = NULL;
6598 int __pyx_lineno = 0;
6599 const char *__pyx_filename = NULL;
6600 int __pyx_clineno = 0;
6601 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6602 __Pyx_TraceCall(
"PyArray_MultiIterNew2", __pyx_f[3], 745, 0, __PYX_ERR(3, 745, __pyx_L1_error));
6611 __Pyx_XDECREF(__pyx_r);
6612 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 746, __pyx_L1_error)
6613 __Pyx_GOTREF(__pyx_t_1);
6614 __pyx_r = __pyx_t_1;
6628 __Pyx_XDECREF(__pyx_t_1);
6629 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6632 __Pyx_XGIVEREF(__pyx_r);
6633 __Pyx_TraceReturn(__pyx_r, 0);
6634 __Pyx_RefNannyFinishContext();
6646 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6647 PyObject *__pyx_r = NULL;
6648 __Pyx_TraceDeclarations
6649 __Pyx_RefNannyDeclarations
6650 PyObject *__pyx_t_1 = NULL;
6651 int __pyx_lineno = 0;
6652 const char *__pyx_filename = NULL;
6653 int __pyx_clineno = 0;
6654 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6655 __Pyx_TraceCall(
"PyArray_MultiIterNew3", __pyx_f[3], 748, 0, __PYX_ERR(3, 748, __pyx_L1_error));
6664 __Pyx_XDECREF(__pyx_r);
6665 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 749, __pyx_L1_error)
6666 __Pyx_GOTREF(__pyx_t_1);
6667 __pyx_r = __pyx_t_1;
6681 __Pyx_XDECREF(__pyx_t_1);
6682 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6685 __Pyx_XGIVEREF(__pyx_r);
6686 __Pyx_TraceReturn(__pyx_r, 0);
6687 __Pyx_RefNannyFinishContext();
6699 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6700 PyObject *__pyx_r = NULL;
6701 __Pyx_TraceDeclarations
6702 __Pyx_RefNannyDeclarations
6703 PyObject *__pyx_t_1 = NULL;
6704 int __pyx_lineno = 0;
6705 const char *__pyx_filename = NULL;
6706 int __pyx_clineno = 0;
6707 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6708 __Pyx_TraceCall(
"PyArray_MultiIterNew4", __pyx_f[3], 751, 0, __PYX_ERR(3, 751, __pyx_L1_error));
6717 __Pyx_XDECREF(__pyx_r);
6718 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 752, __pyx_L1_error)
6719 __Pyx_GOTREF(__pyx_t_1);
6720 __pyx_r = __pyx_t_1;
6734 __Pyx_XDECREF(__pyx_t_1);
6735 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6738 __Pyx_XGIVEREF(__pyx_r);
6739 __Pyx_TraceReturn(__pyx_r, 0);
6740 __Pyx_RefNannyFinishContext();
6752 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6753 PyObject *__pyx_r = NULL;
6754 __Pyx_TraceDeclarations
6755 __Pyx_RefNannyDeclarations
6756 PyObject *__pyx_t_1 = NULL;
6757 int __pyx_lineno = 0;
6758 const char *__pyx_filename = NULL;
6759 int __pyx_clineno = 0;
6760 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6761 __Pyx_TraceCall(
"PyArray_MultiIterNew5", __pyx_f[3], 754, 0, __PYX_ERR(3, 754, __pyx_L1_error));
6770 __Pyx_XDECREF(__pyx_r);
6771 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 755, __pyx_L1_error)
6772 __Pyx_GOTREF(__pyx_t_1);
6773 __pyx_r = __pyx_t_1;
6787 __Pyx_XDECREF(__pyx_t_1);
6788 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6791 __Pyx_XGIVEREF(__pyx_r);
6792 __Pyx_TraceReturn(__pyx_r, 0);
6793 __Pyx_RefNannyFinishContext();
6805 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6806 PyObject *__pyx_r = NULL;
6807 __Pyx_TraceDeclarations
6808 __Pyx_RefNannyDeclarations
6810 int __pyx_lineno = 0;
6811 const char *__pyx_filename = NULL;
6812 int __pyx_clineno = 0;
6813 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6814 __Pyx_TraceCall(
"PyDataType_SHAPE", __pyx_f[3], 757, 0, __PYX_ERR(3, 757, __pyx_L1_error));
6823 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6833 __Pyx_XDECREF(__pyx_r);
6834 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6835 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6855 __Pyx_XDECREF(__pyx_r);
6856 __Pyx_INCREF(__pyx_empty_tuple);
6857 __pyx_r = __pyx_empty_tuple;
6871 __Pyx_AddTraceback(
"numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
6874 __Pyx_XGIVEREF(__pyx_r);
6875 __Pyx_TraceReturn(__pyx_r, 0);
6876 __Pyx_RefNannyFinishContext();
6888 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
6889 PyArray_Descr *__pyx_v_child = 0;
6890 int __pyx_v_endian_detector;
6891 int __pyx_v_little_endian;
6892 PyObject *__pyx_v_fields = 0;
6893 PyObject *__pyx_v_childname = NULL;
6894 PyObject *__pyx_v_new_offset = NULL;
6895 PyObject *__pyx_v_t = NULL;
6897 __Pyx_TraceDeclarations
6898 __Pyx_RefNannyDeclarations
6899 PyObject *__pyx_t_1 = NULL;
6900 Py_ssize_t __pyx_t_2;
6901 PyObject *__pyx_t_3 = NULL;
6902 PyObject *__pyx_t_4 = NULL;
6908 int __pyx_lineno = 0;
6909 const char *__pyx_filename = NULL;
6910 int __pyx_clineno = 0;
6911 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
6912 __Pyx_TraceCall(
"_util_dtypestring", __pyx_f[3], 763, 0, __PYX_ERR(3, 763, __pyx_L1_error));
6921 __pyx_v_endian_detector = 1;
6930 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6939 if (unlikely(__pyx_v_descr->names == Py_None)) {
6940 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
6941 __PYX_ERR(3, 772, __pyx_L1_error)
6943 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6945 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6946 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6947 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(3, 772, __pyx_L1_error)
6949 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 772, __pyx_L1_error)
6950 __Pyx_GOTREF(__pyx_t_3);
6952 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6962 if (unlikely(__pyx_v_descr->fields == Py_None)) {
6963 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6964 __PYX_ERR(3, 773, __pyx_L1_error)
6966 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 773, __pyx_L1_error)
6967 __Pyx_GOTREF(__pyx_t_3);
6968 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 773, __pyx_L1_error)
6969 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6979 if (likely(__pyx_v_fields != Py_None)) {
6980 PyObject* sequence = __pyx_v_fields;
6981 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6982 if (unlikely(size != 2)) {
6983 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6984 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6985 __PYX_ERR(3, 774, __pyx_L1_error)
6987 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6988 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6989 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6990 __Pyx_INCREF(__pyx_t_3);
6991 __Pyx_INCREF(__pyx_t_4);
6993 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 774, __pyx_L1_error)
6994 __Pyx_GOTREF(__pyx_t_3);
6995 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 774, __pyx_L1_error)
6996 __Pyx_GOTREF(__pyx_t_4);
6999 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 774, __pyx_L1_error)
7001 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 774, __pyx_L1_error)
7002 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7004 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7014 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 776, __pyx_L1_error)
7015 __Pyx_GOTREF(__pyx_t_4);
7016 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 776, __pyx_L1_error)
7017 __Pyx_GOTREF(__pyx_t_3);
7018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7019 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(3, 776, __pyx_L1_error)
7020 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7021 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
7022 if (unlikely(__pyx_t_6)) {
7031 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 777, __pyx_L1_error)
7032 __Pyx_GOTREF(__pyx_t_3);
7033 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7034 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7035 __PYX_ERR(3, 777, __pyx_L1_error)
7053 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
7055 goto __pyx_L8_next_or;
7058 __pyx_t_7 = (__pyx_v_little_endian != 0);
7061 __pyx_t_6 = __pyx_t_7;
7062 goto __pyx_L7_bool_binop_done;
7073 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
7076 __pyx_t_6 = __pyx_t_7;
7077 goto __pyx_L7_bool_binop_done;
7079 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7080 __pyx_t_6 = __pyx_t_7;
7081 __pyx_L7_bool_binop_done:;
7090 if (unlikely(__pyx_t_6)) {
7099 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 781, __pyx_L1_error)
7100 __Pyx_GOTREF(__pyx_t_3);
7101 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7103 __PYX_ERR(3, 781, __pyx_L1_error)
7122 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 791, __pyx_L1_error)
7123 __Pyx_GOTREF(__pyx_t_3);
7124 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 791, __pyx_L1_error)
7125 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7126 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 791, __pyx_L1_error)
7127 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7128 if (!__pyx_t_6)
break;
7137 (__pyx_v_f[0]) = 0x78;
7146 __pyx_v_f = (__pyx_v_f + 1);
7156 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7167 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7176 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7186 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 799, __pyx_L1_error)
7187 __Pyx_GOTREF(__pyx_t_4);
7188 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7198 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7199 if (unlikely(__pyx_t_6)) {
7208 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 801, __pyx_L1_error)
7209 __Pyx_GOTREF(__pyx_t_4);
7210 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7211 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7212 __PYX_ERR(3, 801, __pyx_L1_error)
7230 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 804, __pyx_L1_error)
7231 __Pyx_GOTREF(__pyx_t_4);
7232 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 804, __pyx_L1_error)
7233 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7234 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 804, __pyx_L1_error)
7235 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7237 (__pyx_v_f[0]) = 98;
7248 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
7249 __Pyx_GOTREF(__pyx_t_3);
7250 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 805, __pyx_L1_error)
7251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7252 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 805, __pyx_L1_error)
7253 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7255 (__pyx_v_f[0]) = 66;
7266 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 806, __pyx_L1_error)
7267 __Pyx_GOTREF(__pyx_t_4);
7268 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
7269 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7270 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 806, __pyx_L1_error)
7271 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7273 (__pyx_v_f[0]) = 0x68;
7284 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
7285 __Pyx_GOTREF(__pyx_t_3);
7286 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
7287 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7288 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 807, __pyx_L1_error)
7289 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7291 (__pyx_v_f[0]) = 72;
7302 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 808, __pyx_L1_error)
7303 __Pyx_GOTREF(__pyx_t_4);
7304 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 808, __pyx_L1_error)
7305 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7306 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 808, __pyx_L1_error)
7307 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7309 (__pyx_v_f[0]) = 0x69;
7320 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
7321 __Pyx_GOTREF(__pyx_t_3);
7322 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
7323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7324 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 809, __pyx_L1_error)
7325 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7327 (__pyx_v_f[0]) = 73;
7338 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 810, __pyx_L1_error)
7339 __Pyx_GOTREF(__pyx_t_4);
7340 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
7341 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7342 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 810, __pyx_L1_error)
7343 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7345 (__pyx_v_f[0]) = 0x6C;
7356 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 811, __pyx_L1_error)
7357 __Pyx_GOTREF(__pyx_t_3);
7358 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 811, __pyx_L1_error)
7359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7360 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 811, __pyx_L1_error)
7361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7363 (__pyx_v_f[0]) = 76;
7374 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 812, __pyx_L1_error)
7375 __Pyx_GOTREF(__pyx_t_4);
7376 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 812, __pyx_L1_error)
7377 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7378 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 812, __pyx_L1_error)
7379 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7381 (__pyx_v_f[0]) = 0x71;
7392 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error)
7393 __Pyx_GOTREF(__pyx_t_3);
7394 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error)
7395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7396 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error)
7397 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7399 (__pyx_v_f[0]) = 81;
7410 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 814, __pyx_L1_error)
7411 __Pyx_GOTREF(__pyx_t_4);
7412 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
7413 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7414 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 814, __pyx_L1_error)
7415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7417 (__pyx_v_f[0]) = 0x66;
7428 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 815, __pyx_L1_error)
7429 __Pyx_GOTREF(__pyx_t_3);
7430 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 815, __pyx_L1_error)
7431 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7432 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 815, __pyx_L1_error)
7433 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7435 (__pyx_v_f[0]) = 0x64;
7446 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 816, __pyx_L1_error)
7447 __Pyx_GOTREF(__pyx_t_4);
7448 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 816, __pyx_L1_error)
7449 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7450 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 816, __pyx_L1_error)
7451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7453 (__pyx_v_f[0]) = 0x67;
7464 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 817, __pyx_L1_error)
7465 __Pyx_GOTREF(__pyx_t_3);
7466 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 817, __pyx_L1_error)
7467 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7468 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 817, __pyx_L1_error)
7469 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7471 (__pyx_v_f[0]) = 90;
7472 (__pyx_v_f[1]) = 0x66;
7473 __pyx_v_f = (__pyx_v_f + 1);
7484 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 818, __pyx_L1_error)
7485 __Pyx_GOTREF(__pyx_t_4);
7486 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 818, __pyx_L1_error)
7487 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7488 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 818, __pyx_L1_error)
7489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7491 (__pyx_v_f[0]) = 90;
7492 (__pyx_v_f[1]) = 0x64;
7493 __pyx_v_f = (__pyx_v_f + 1);
7504 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 819, __pyx_L1_error)
7505 __Pyx_GOTREF(__pyx_t_3);
7506 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 819, __pyx_L1_error)
7507 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7508 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 819, __pyx_L1_error)
7509 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7511 (__pyx_v_f[0]) = 90;
7512 (__pyx_v_f[1]) = 0x67;
7513 __pyx_v_f = (__pyx_v_f + 1);
7524 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 820, __pyx_L1_error)
7525 __Pyx_GOTREF(__pyx_t_4);
7526 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 820, __pyx_L1_error)
7527 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7528 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 820, __pyx_L1_error)
7529 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7530 if (likely(__pyx_t_6)) {
7531 (__pyx_v_f[0]) = 79;
7543 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 822, __pyx_L1_error)
7544 __Pyx_GOTREF(__pyx_t_3);
7545 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 822, __pyx_L1_error)
7546 __Pyx_GOTREF(__pyx_t_4);
7547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7548 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7549 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7550 __PYX_ERR(3, 822, __pyx_L1_error)
7561 __pyx_v_f = (__pyx_v_f + 1);
7581 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(3, 827, __pyx_L1_error)
7582 __pyx_v_f = __pyx_t_9;
7594 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7603 __pyx_r = __pyx_v_f;
7616 __Pyx_XDECREF(__pyx_t_1);
7617 __Pyx_XDECREF(__pyx_t_3);
7618 __Pyx_XDECREF(__pyx_t_4);
7619 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7622 __Pyx_XDECREF((PyObject *)__pyx_v_child);
7623 __Pyx_XDECREF(__pyx_v_fields);
7624 __Pyx_XDECREF(__pyx_v_childname);
7625 __Pyx_XDECREF(__pyx_v_new_offset);
7626 __Pyx_XDECREF(__pyx_v_t);
7627 __Pyx_TraceReturn(Py_None, 0);
7628 __Pyx_RefNannyFinishContext();
7640 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7641 __Pyx_TraceDeclarations
7642 __Pyx_RefNannyDeclarations
7643 int __pyx_lineno = 0;
7644 const char *__pyx_filename = NULL;
7645 int __pyx_clineno = 0;
7646 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7647 __Pyx_TraceCall(
"set_array_base", __pyx_f[3], 943, 0, __PYX_ERR(3, 943, __pyx_L1_error));
7656 Py_INCREF(__pyx_v_base);
7665 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7678 __Pyx_WriteUnraisable(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7680 __Pyx_TraceReturn(Py_None, 0);
7681 __Pyx_RefNannyFinishContext();
7692 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7693 PyObject *__pyx_v_base;
7694 PyObject *__pyx_r = NULL;
7695 __Pyx_TraceDeclarations
7696 __Pyx_RefNannyDeclarations
7698 int __pyx_lineno = 0;
7699 const char *__pyx_filename = NULL;
7700 int __pyx_clineno = 0;
7701 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7702 __Pyx_TraceCall(
"get_array_base", __pyx_f[3], 947, 0, __PYX_ERR(3, 947, __pyx_L1_error));
7711 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7720 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7730 __Pyx_XDECREF(__pyx_r);
7731 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7750 __Pyx_XDECREF(__pyx_r);
7751 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7752 __pyx_r = ((PyObject *)__pyx_v_base);
7765 __Pyx_AddTraceback(
"numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
7768 __Pyx_XGIVEREF(__pyx_r);
7769 __Pyx_TraceReturn(__pyx_r, 0);
7770 __Pyx_RefNannyFinishContext();
7782 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7784 __Pyx_TraceDeclarations
7785 __Pyx_RefNannyDeclarations
7786 PyObject *__pyx_t_1 = NULL;
7787 PyObject *__pyx_t_2 = NULL;
7788 PyObject *__pyx_t_3 = NULL;
7790 PyObject *__pyx_t_5 = NULL;
7791 PyObject *__pyx_t_6 = NULL;
7792 PyObject *__pyx_t_7 = NULL;
7793 PyObject *__pyx_t_8 = NULL;
7794 int __pyx_lineno = 0;
7795 const char *__pyx_filename = NULL;
7796 int __pyx_clineno = 0;
7797 __Pyx_RefNannySetupContext(
"import_array", 0);
7798 __Pyx_TraceCall(
"import_array", __pyx_f[3], 955, 0, __PYX_ERR(3, 955, __pyx_L1_error));
7808 __Pyx_PyThreadState_declare
7809 __Pyx_PyThreadState_assign
7810 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7811 __Pyx_XGOTREF(__pyx_t_1);
7812 __Pyx_XGOTREF(__pyx_t_2);
7813 __Pyx_XGOTREF(__pyx_t_3);
7823 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 957, __pyx_L3_error)
7833 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7834 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7835 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7836 goto __pyx_L8_try_end;
7846 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7848 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7849 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 958, __pyx_L5_except_error)
7850 __Pyx_GOTREF(__pyx_t_5);
7851 __Pyx_GOTREF(__pyx_t_6);
7852 __Pyx_GOTREF(__pyx_t_7);
7861 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 959, __pyx_L5_except_error)
7862 __Pyx_GOTREF(__pyx_t_8);
7863 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7864 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7865 __PYX_ERR(3, 959, __pyx_L5_except_error)
7867 goto __pyx_L5_except_error;
7868 __pyx_L5_except_error:;
7877 __Pyx_XGIVEREF(__pyx_t_1);
7878 __Pyx_XGIVEREF(__pyx_t_2);
7879 __Pyx_XGIVEREF(__pyx_t_3);
7880 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7881 goto __pyx_L1_error;
7897 __Pyx_XDECREF(__pyx_t_5);
7898 __Pyx_XDECREF(__pyx_t_6);
7899 __Pyx_XDECREF(__pyx_t_7);
7900 __Pyx_XDECREF(__pyx_t_8);
7901 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7904 __Pyx_TraceReturn(Py_None, 0);
7905 __Pyx_RefNannyFinishContext();
7917 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7919 __Pyx_TraceDeclarations
7920 __Pyx_RefNannyDeclarations
7921 PyObject *__pyx_t_1 = NULL;
7922 PyObject *__pyx_t_2 = NULL;
7923 PyObject *__pyx_t_3 = NULL;
7925 PyObject *__pyx_t_5 = NULL;
7926 PyObject *__pyx_t_6 = NULL;
7927 PyObject *__pyx_t_7 = NULL;
7928 PyObject *__pyx_t_8 = NULL;
7929 int __pyx_lineno = 0;
7930 const char *__pyx_filename = NULL;
7931 int __pyx_clineno = 0;
7932 __Pyx_RefNannySetupContext(
"import_umath", 0);
7933 __Pyx_TraceCall(
"import_umath", __pyx_f[3], 961, 0, __PYX_ERR(3, 961, __pyx_L1_error));
7943 __Pyx_PyThreadState_declare
7944 __Pyx_PyThreadState_assign
7945 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7946 __Pyx_XGOTREF(__pyx_t_1);
7947 __Pyx_XGOTREF(__pyx_t_2);
7948 __Pyx_XGOTREF(__pyx_t_3);
7958 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 963, __pyx_L3_error)
7968 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7969 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7970 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7971 goto __pyx_L8_try_end;
7981 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7983 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7984 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 964, __pyx_L5_except_error)
7985 __Pyx_GOTREF(__pyx_t_5);
7986 __Pyx_GOTREF(__pyx_t_6);
7987 __Pyx_GOTREF(__pyx_t_7);
7996 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 965, __pyx_L5_except_error)
7997 __Pyx_GOTREF(__pyx_t_8);
7998 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7999 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8000 __PYX_ERR(3, 965, __pyx_L5_except_error)
8002 goto __pyx_L5_except_error;
8003 __pyx_L5_except_error:;
8012 __Pyx_XGIVEREF(__pyx_t_1);
8013 __Pyx_XGIVEREF(__pyx_t_2);
8014 __Pyx_XGIVEREF(__pyx_t_3);
8015 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8016 goto __pyx_L1_error;
8032 __Pyx_XDECREF(__pyx_t_5);
8033 __Pyx_XDECREF(__pyx_t_6);
8034 __Pyx_XDECREF(__pyx_t_7);
8035 __Pyx_XDECREF(__pyx_t_8);
8036 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8039 __Pyx_TraceReturn(Py_None, 0);
8040 __Pyx_RefNannyFinishContext();
8052 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8054 __Pyx_TraceDeclarations
8055 __Pyx_RefNannyDeclarations
8056 PyObject *__pyx_t_1 = NULL;
8057 PyObject *__pyx_t_2 = NULL;
8058 PyObject *__pyx_t_3 = NULL;
8060 PyObject *__pyx_t_5 = NULL;
8061 PyObject *__pyx_t_6 = NULL;
8062 PyObject *__pyx_t_7 = NULL;
8063 PyObject *__pyx_t_8 = NULL;
8064 int __pyx_lineno = 0;
8065 const char *__pyx_filename = NULL;
8066 int __pyx_clineno = 0;
8067 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
8068 __Pyx_TraceCall(
"import_ufunc", __pyx_f[3], 967, 0, __PYX_ERR(3, 967, __pyx_L1_error));
8078 __Pyx_PyThreadState_declare
8079 __Pyx_PyThreadState_assign
8080 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8081 __Pyx_XGOTREF(__pyx_t_1);
8082 __Pyx_XGOTREF(__pyx_t_2);
8083 __Pyx_XGOTREF(__pyx_t_3);
8093 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 969, __pyx_L3_error)
8103 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8104 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8105 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8106 goto __pyx_L8_try_end;
8116 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8118 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8119 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 970, __pyx_L5_except_error)
8120 __Pyx_GOTREF(__pyx_t_5);
8121 __Pyx_GOTREF(__pyx_t_6);
8122 __Pyx_GOTREF(__pyx_t_7);
8131 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 971, __pyx_L5_except_error)
8132 __Pyx_GOTREF(__pyx_t_8);
8133 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8134 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8135 __PYX_ERR(3, 971, __pyx_L5_except_error)
8137 goto __pyx_L5_except_error;
8138 __pyx_L5_except_error:;
8147 __Pyx_XGIVEREF(__pyx_t_1);
8148 __Pyx_XGIVEREF(__pyx_t_2);
8149 __Pyx_XGIVEREF(__pyx_t_3);
8150 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8151 goto __pyx_L1_error;
8167 __Pyx_XDECREF(__pyx_t_5);
8168 __Pyx_XDECREF(__pyx_t_6);
8169 __Pyx_XDECREF(__pyx_t_7);
8170 __Pyx_XDECREF(__pyx_t_8);
8171 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8174 __Pyx_TraceReturn(Py_None, 0);
8175 __Pyx_RefNannyFinishContext();
8188 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8189 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8190 PyObject *__pyx_v_shape = 0;
8191 Py_ssize_t __pyx_v_itemsize;
8192 PyObject *__pyx_v_format = 0;
8193 PyObject *__pyx_v_mode = 0;
8194 int __pyx_v_allocate_buffer;
8195 int __pyx_lineno = 0;
8196 const char *__pyx_filename = NULL;
8197 int __pyx_clineno = 0;
8199 __Pyx_RefNannyDeclarations
8200 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8202 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8203 PyObject* values[5] = {0,0,0,0,0};
8204 values[3] = ((PyObject *)__pyx_n_s_c);
8205 if (unlikely(__pyx_kwds)) {
8207 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8209 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8211 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8213 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8215 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8217 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8220 default:
goto __pyx_L5_argtuple_error;
8222 kw_args = PyDict_Size(__pyx_kwds);
8225 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8226 else goto __pyx_L5_argtuple_error;
8229 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8231 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8235 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8237 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8242 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8243 if (value) { values[3] = value; kw_args--; }
8248 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8249 if (value) { values[4] = value; kw_args--; }
8252 if (unlikely(kw_args > 0)) {
8253 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8256 switch (PyTuple_GET_SIZE(__pyx_args)) {
8257 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8259 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8261 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8262 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8263 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8265 default:
goto __pyx_L5_argtuple_error;
8268 __pyx_v_shape = ((PyObject*)values[0]);
8269 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8270 __pyx_v_format = values[2];
8271 __pyx_v_mode = values[3];
8273 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8283 __pyx_v_allocate_buffer = ((int)1);
8286 goto __pyx_L4_argument_unpacking_done;
8287 __pyx_L5_argtuple_error:;
8288 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8290 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8291 __Pyx_RefNannyFinishContext();
8293 __pyx_L4_argument_unpacking_done:;
8294 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8295 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8296 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
8298 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8313 __Pyx_RefNannyFinishContext();
8317 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
8319 Py_ssize_t __pyx_v_i;
8320 Py_ssize_t __pyx_v_dim;
8321 PyObject **__pyx_v_p;
8324 __Pyx_TraceDeclarations
8325 __Pyx_RefNannyDeclarations
8326 Py_ssize_t __pyx_t_1;
8328 PyObject *__pyx_t_3 = NULL;
8330 PyObject *__pyx_t_5 = NULL;
8331 PyObject *__pyx_t_6 = NULL;
8334 Py_ssize_t __pyx_t_9;
8335 PyObject *__pyx_t_10 = NULL;
8336 Py_ssize_t __pyx_t_11;
8337 int __pyx_lineno = 0;
8338 const char *__pyx_filename = NULL;
8339 int __pyx_clineno = 0;
8340 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8341 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
8342 __Pyx_INCREF(__pyx_v_format);
8351 if (unlikely(__pyx_v_shape == Py_None)) {
8352 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8353 __PYX_ERR(1, 129, __pyx_L1_error)
8355 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8356 __pyx_v_self->ndim = ((int)__pyx_t_1);
8365 __pyx_v_self->itemsize = __pyx_v_itemsize;
8374 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8375 if (unlikely(__pyx_t_2)) {
8384 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8385 __Pyx_GOTREF(__pyx_t_3);
8386 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8387 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8388 __PYX_ERR(1, 133, __pyx_L1_error)
8406 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8407 if (unlikely(__pyx_t_2)) {
8416 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8417 __Pyx_GOTREF(__pyx_t_3);
8418 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8419 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8420 __PYX_ERR(1, 136, __pyx_L1_error)
8438 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8439 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8449 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8450 __Pyx_GOTREF(__pyx_t_5);
8452 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8453 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8454 if (likely(__pyx_t_6)) {
8455 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8456 __Pyx_INCREF(__pyx_t_6);
8457 __Pyx_INCREF(
function);
8458 __Pyx_DECREF_SET(__pyx_t_5,
function);
8461 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8462 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8463 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8464 __Pyx_GOTREF(__pyx_t_3);
8465 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8466 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8485 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8486 __pyx_t_3 = __pyx_v_format;
8487 __Pyx_INCREF(__pyx_t_3);
8488 __Pyx_GIVEREF(__pyx_t_3);
8489 __Pyx_GOTREF(__pyx_v_self->_format);
8490 __Pyx_DECREF(__pyx_v_self->_format);
8491 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8501 if (unlikely(__pyx_v_self->_format == Py_None)) {
8502 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8503 __PYX_ERR(1, 141, __pyx_L1_error)
8505 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8506 __pyx_v_self->format = __pyx_t_7;
8515 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8524 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8533 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8534 if (unlikely(__pyx_t_4)) {
8543 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8544 __Pyx_GOTREF(__pyx_t_3);
8545 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8546 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8547 __PYX_ERR(1, 148, __pyx_L1_error)
8566 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8568 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8569 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8570 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8572 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8573 __Pyx_GOTREF(__pyx_t_5);
8575 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8576 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8577 __pyx_v_dim = __pyx_t_9;
8578 __pyx_v_idx = __pyx_t_8;
8579 __pyx_t_8 = (__pyx_t_8 + 1);
8588 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8589 if (unlikely(__pyx_t_4)) {
8598 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8599 __Pyx_GOTREF(__pyx_t_5);
8600 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8601 __Pyx_GOTREF(__pyx_t_6);
8602 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8603 __Pyx_GOTREF(__pyx_t_10);
8604 __Pyx_GIVEREF(__pyx_t_5);
8605 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8606 __Pyx_GIVEREF(__pyx_t_6);
8607 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8610 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8611 __Pyx_GOTREF(__pyx_t_6);
8612 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8613 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8614 __Pyx_GOTREF(__pyx_t_10);
8615 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8616 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8617 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8618 __PYX_ERR(1, 153, __pyx_L1_error)
8636 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8655 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8665 __pyx_v_order =
'F';
8674 __Pyx_INCREF(__pyx_n_u_fortran);
8675 __Pyx_GIVEREF(__pyx_n_u_fortran);
8676 __Pyx_GOTREF(__pyx_v_self->mode);
8677 __Pyx_DECREF(__pyx_v_self->mode);
8678 __pyx_v_self->mode = __pyx_n_u_fortran;
8697 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8698 if (likely(__pyx_t_4)) {
8707 __pyx_v_order =
'C';
8716 __Pyx_INCREF(__pyx_n_u_c);
8717 __Pyx_GIVEREF(__pyx_n_u_c);
8718 __Pyx_GOTREF(__pyx_v_self->mode);
8719 __Pyx_DECREF(__pyx_v_self->mode);
8720 __pyx_v_self->mode = __pyx_n_u_c;
8740 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8741 __Pyx_GOTREF(__pyx_t_3);
8742 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8743 __Pyx_GOTREF(__pyx_t_10);
8744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8745 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8746 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8747 __PYX_ERR(1, 164, __pyx_L1_error)
8758 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8767 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8776 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8777 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8778 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8779 __pyx_v_self->dtype_is_object = __pyx_t_4;
8788 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8798 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
8807 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8808 if (unlikely(__pyx_t_4)) {
8817 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8818 __Pyx_GOTREF(__pyx_t_10);
8819 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8820 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8821 __PYX_ERR(1, 176, __pyx_L1_error)
8839 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8849 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8858 if (unlikely(__pyx_v_itemsize == 0)) {
8859 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
8860 __PYX_ERR(1, 180, __pyx_L1_error)
8862 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8863 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
8864 __PYX_ERR(1, 180, __pyx_L1_error)
8866 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8867 __pyx_t_9 = __pyx_t_1;
8868 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8869 __pyx_v_i = __pyx_t_11;
8878 (__pyx_v_p[__pyx_v_i]) = Py_None;
8920 __Pyx_XDECREF(__pyx_t_3);
8921 __Pyx_XDECREF(__pyx_t_5);
8922 __Pyx_XDECREF(__pyx_t_6);
8923 __Pyx_XDECREF(__pyx_t_10);
8924 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8927 __Pyx_XDECREF(__pyx_v_format);
8928 __Pyx_TraceReturn(Py_None, 0);
8929 __Pyx_RefNannyFinishContext();
8942 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8943 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8945 __Pyx_RefNannyDeclarations
8946 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8947 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
8950 __Pyx_RefNannyFinishContext();
8954 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8955 int __pyx_v_bufmode;
8957 __Pyx_TraceDeclarations
8958 __Pyx_RefNannyDeclarations
8961 PyObject *__pyx_t_3 = NULL;
8963 Py_ssize_t __pyx_t_5;
8965 Py_ssize_t *__pyx_t_7;
8966 int __pyx_lineno = 0;
8967 const char *__pyx_filename = NULL;
8968 int __pyx_clineno = 0;
8969 if (__pyx_v_info == NULL) {
8970 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
8973 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8974 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8975 __Pyx_GIVEREF(__pyx_v_info->obj);
8976 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
8985 __pyx_v_bufmode = -1;
8994 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8995 __pyx_t_2 = (__pyx_t_1 != 0);
9005 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9024 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9025 __pyx_t_1 = (__pyx_t_2 != 0);
9035 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9054 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9055 if (unlikely(__pyx_t_1)) {
9064 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9065 __Pyx_GOTREF(__pyx_t_3);
9066 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9067 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9068 __PYX_ERR(1, 192, __pyx_L1_error)
9086 __pyx_t_4 = __pyx_v_self->data;
9087 __pyx_v_info->buf = __pyx_t_4;
9096 __pyx_t_5 = __pyx_v_self->len;
9097 __pyx_v_info->len = __pyx_t_5;
9106 __pyx_t_6 = __pyx_v_self->ndim;
9107 __pyx_v_info->ndim = __pyx_t_6;
9116 __pyx_t_7 = __pyx_v_self->_shape;
9117 __pyx_v_info->shape = __pyx_t_7;
9126 __pyx_t_7 = __pyx_v_self->_strides;
9127 __pyx_v_info->strides = __pyx_t_7;
9136 __pyx_v_info->suboffsets = NULL;
9145 __pyx_t_5 = __pyx_v_self->itemsize;
9146 __pyx_v_info->itemsize = __pyx_t_5;
9155 __pyx_v_info->readonly = 0;
9164 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9174 __pyx_t_4 = __pyx_v_self->format;
9175 __pyx_v_info->format = __pyx_t_4;
9195 __pyx_v_info->format = NULL;
9206 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9207 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9208 __Pyx_GOTREF(__pyx_v_info->obj);
9209 __Pyx_DECREF(__pyx_v_info->obj);
9210 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9224 __Pyx_XDECREF(__pyx_t_3);
9225 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9227 if (__pyx_v_info->obj != NULL) {
9228 __Pyx_GOTREF(__pyx_v_info->obj);
9229 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9233 if (__pyx_v_info->obj == Py_None) {
9234 __Pyx_GOTREF(__pyx_v_info->obj);
9235 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9238 __Pyx_TraceReturn(Py_None, 0);
9239 __Pyx_RefNannyFinishContext();
9252 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9253 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9254 __Pyx_RefNannyDeclarations
9255 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9256 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9259 __Pyx_RefNannyFinishContext();
9262 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9263 __Pyx_TraceDeclarations
9264 __Pyx_RefNannyDeclarations
9266 int __pyx_lineno = 0;
9267 const char *__pyx_filename = NULL;
9268 int __pyx_clineno = 0;
9269 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9270 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
9279 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9289 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9308 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9318 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9328 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9346 free(__pyx_v_self->data);
9365 PyObject_Free(__pyx_v_self->_shape);
9378 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9380 __Pyx_TraceReturn(Py_None, 0);
9381 __Pyx_RefNannyFinishContext();
9393 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9394 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9395 PyObject *__pyx_r = 0;
9396 __Pyx_RefNannyDeclarations
9397 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9398 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9401 __Pyx_RefNannyFinishContext();
9405 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9406 PyObject *__pyx_r = NULL;
9407 __Pyx_TraceDeclarations
9408 __Pyx_RefNannyDeclarations
9409 PyObject *__pyx_t_1 = NULL;
9410 int __pyx_lineno = 0;
9411 const char *__pyx_filename = NULL;
9412 int __pyx_clineno = 0;
9413 __Pyx_RefNannySetupContext(
"__get__", 0);
9414 __Pyx_TraceCall(
"__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
9423 __Pyx_XDECREF(__pyx_r);
9424 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9425 __Pyx_GOTREF(__pyx_t_1);
9426 __pyx_r = __pyx_t_1;
9440 __Pyx_XDECREF(__pyx_t_1);
9441 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9444 __Pyx_XGIVEREF(__pyx_r);
9445 __Pyx_TraceReturn(__pyx_r, 0);
9446 __Pyx_RefNannyFinishContext();
9458 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9460 PyObject *__pyx_r = NULL;
9461 __Pyx_TraceDeclarations
9462 __Pyx_RefNannyDeclarations
9463 PyObject *__pyx_t_1 = NULL;
9464 PyObject *__pyx_t_2 = NULL;
9465 PyObject *__pyx_t_3 = NULL;
9466 int __pyx_lineno = 0;
9467 const char *__pyx_filename = NULL;
9468 int __pyx_clineno = 0;
9469 __Pyx_RefNannySetupContext(
"get_memview", 0);
9470 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
9479 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9488 __Pyx_XDECREF(__pyx_r);
9489 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9490 __Pyx_GOTREF(__pyx_t_1);
9491 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9492 __Pyx_GOTREF(__pyx_t_2);
9493 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9494 __Pyx_GOTREF(__pyx_t_3);
9495 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9496 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9497 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9498 __Pyx_GIVEREF(__pyx_t_1);
9499 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9500 __Pyx_GIVEREF(__pyx_t_2);
9501 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9504 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9505 __Pyx_GOTREF(__pyx_t_2);
9506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9507 __pyx_r = __pyx_t_2;
9521 __Pyx_XDECREF(__pyx_t_1);
9522 __Pyx_XDECREF(__pyx_t_2);
9523 __Pyx_XDECREF(__pyx_t_3);
9524 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9527 __Pyx_XGIVEREF(__pyx_r);
9528 __Pyx_TraceReturn(__pyx_r, 0);
9529 __Pyx_RefNannyFinishContext();
9542 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9543 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9545 __Pyx_RefNannyDeclarations
9546 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9547 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9550 __Pyx_RefNannyFinishContext();
9554 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9556 __Pyx_TraceDeclarations
9557 __Pyx_RefNannyDeclarations
9558 int __pyx_lineno = 0;
9559 const char *__pyx_filename = NULL;
9560 int __pyx_clineno = 0;
9561 __Pyx_RefNannySetupContext(
"__len__", 0);
9562 __Pyx_TraceCall(
"__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
9571 __pyx_r = (__pyx_v_self->_shape[0]);
9584 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9587 __Pyx_TraceReturn(Py_None, 0);
9588 __Pyx_RefNannyFinishContext();
9601 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9602 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9603 PyObject *__pyx_r = 0;
9604 __Pyx_RefNannyDeclarations
9605 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9606 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9609 __Pyx_RefNannyFinishContext();
9613 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9614 PyObject *__pyx_r = NULL;
9615 __Pyx_TraceDeclarations
9616 __Pyx_RefNannyDeclarations
9617 PyObject *__pyx_t_1 = NULL;
9618 PyObject *__pyx_t_2 = NULL;
9619 int __pyx_lineno = 0;
9620 const char *__pyx_filename = NULL;
9621 int __pyx_clineno = 0;
9622 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9623 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
9632 __Pyx_XDECREF(__pyx_r);
9633 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9634 __Pyx_GOTREF(__pyx_t_1);
9635 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9636 __Pyx_GOTREF(__pyx_t_2);
9637 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9638 __pyx_r = __pyx_t_2;
9652 __Pyx_XDECREF(__pyx_t_1);
9653 __Pyx_XDECREF(__pyx_t_2);
9654 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9657 __Pyx_XGIVEREF(__pyx_r);
9658 __Pyx_TraceReturn(__pyx_r, 0);
9659 __Pyx_RefNannyFinishContext();
9672 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9673 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9674 PyObject *__pyx_r = 0;
9675 __Pyx_RefNannyDeclarations
9676 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9677 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9680 __Pyx_RefNannyFinishContext();
9684 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9685 PyObject *__pyx_r = NULL;
9686 __Pyx_TraceDeclarations
9687 __Pyx_RefNannyDeclarations
9688 PyObject *__pyx_t_1 = NULL;
9689 PyObject *__pyx_t_2 = NULL;
9690 int __pyx_lineno = 0;
9691 const char *__pyx_filename = NULL;
9692 int __pyx_clineno = 0;
9693 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9694 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
9703 __Pyx_XDECREF(__pyx_r);
9704 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9705 __Pyx_GOTREF(__pyx_t_1);
9706 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9707 __Pyx_GOTREF(__pyx_t_2);
9708 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9709 __pyx_r = __pyx_t_2;
9723 __Pyx_XDECREF(__pyx_t_1);
9724 __Pyx_XDECREF(__pyx_t_2);
9725 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9728 __Pyx_XGIVEREF(__pyx_r);
9729 __Pyx_TraceReturn(__pyx_r, 0);
9730 __Pyx_RefNannyFinishContext();
9743 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9744 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9746 __Pyx_RefNannyDeclarations
9747 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9748 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9751 __Pyx_RefNannyFinishContext();
9755 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9757 __Pyx_TraceDeclarations
9758 __Pyx_RefNannyDeclarations
9759 PyObject *__pyx_t_1 = NULL;
9760 int __pyx_lineno = 0;
9761 const char *__pyx_filename = NULL;
9762 int __pyx_clineno = 0;
9763 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9764 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
9773 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9774 __Pyx_GOTREF(__pyx_t_1);
9775 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9776 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9790 __Pyx_XDECREF(__pyx_t_1);
9791 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9794 __Pyx_TraceReturn(Py_None, 0);
9795 __Pyx_RefNannyFinishContext();
9806 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9807 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9808 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9809 PyObject *__pyx_r = 0;
9810 __Pyx_RefNannyDeclarations
9811 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9812 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9815 __Pyx_RefNannyFinishContext();
9819 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9820 PyObject *__pyx_r = NULL;
9821 __Pyx_TraceDeclarations
9822 __Pyx_RefNannyDeclarations
9823 PyObject *__pyx_t_1 = NULL;
9824 int __pyx_lineno = 0;
9825 const char *__pyx_filename = NULL;
9826 int __pyx_clineno = 0;
9827 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9828 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9836 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9837 __Pyx_GOTREF(__pyx_t_1);
9838 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9839 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9840 __PYX_ERR(1, 2, __pyx_L1_error)
9850 __Pyx_XDECREF(__pyx_t_1);
9851 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9853 __Pyx_XGIVEREF(__pyx_r);
9854 __Pyx_TraceReturn(__pyx_r, 0);
9855 __Pyx_RefNannyFinishContext();
9867 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9868 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9869 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9870 PyObject *__pyx_r = 0;
9871 __Pyx_RefNannyDeclarations
9872 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9873 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9876 __Pyx_RefNannyFinishContext();
9880 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9881 PyObject *__pyx_r = NULL;
9882 __Pyx_TraceDeclarations
9883 __Pyx_RefNannyDeclarations
9884 PyObject *__pyx_t_1 = NULL;
9885 int __pyx_lineno = 0;
9886 const char *__pyx_filename = NULL;
9887 int __pyx_clineno = 0;
9888 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9889 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
9896 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9897 __Pyx_GOTREF(__pyx_t_1);
9898 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9899 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9900 __PYX_ERR(1, 4, __pyx_L1_error)
9911 __Pyx_XDECREF(__pyx_t_1);
9912 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9914 __Pyx_XGIVEREF(__pyx_r);
9915 __Pyx_TraceReturn(__pyx_r, 0);
9916 __Pyx_RefNannyFinishContext();
9928 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
9929 struct __pyx_array_obj *__pyx_v_result = 0;
9930 struct __pyx_array_obj *__pyx_r = NULL;
9931 __Pyx_TraceDeclarations
9932 __Pyx_RefNannyDeclarations
9934 PyObject *__pyx_t_2 = NULL;
9935 PyObject *__pyx_t_3 = NULL;
9936 PyObject *__pyx_t_4 = NULL;
9937 PyObject *__pyx_t_5 = NULL;
9938 int __pyx_lineno = 0;
9939 const char *__pyx_filename = NULL;
9940 int __pyx_clineno = 0;
9941 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
9942 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
9951 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9961 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9962 __Pyx_GOTREF(__pyx_t_2);
9963 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9964 __Pyx_GOTREF(__pyx_t_3);
9965 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9966 __Pyx_GOTREF(__pyx_t_4);
9967 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9968 __Pyx_GOTREF(__pyx_t_5);
9969 __Pyx_INCREF(__pyx_v_shape);
9970 __Pyx_GIVEREF(__pyx_v_shape);
9971 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9972 __Pyx_GIVEREF(__pyx_t_2);
9973 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9974 __Pyx_GIVEREF(__pyx_t_3);
9975 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9976 __Pyx_GIVEREF(__pyx_t_4);
9977 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9981 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9982 __Pyx_GOTREF(__pyx_t_4);
9983 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9984 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
10005 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10006 __Pyx_GOTREF(__pyx_t_4);
10007 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10008 __Pyx_GOTREF(__pyx_t_5);
10009 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10010 __Pyx_GOTREF(__pyx_t_3);
10011 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10012 __Pyx_GOTREF(__pyx_t_2);
10013 __Pyx_INCREF(__pyx_v_shape);
10014 __Pyx_GIVEREF(__pyx_v_shape);
10015 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10016 __Pyx_GIVEREF(__pyx_t_4);
10017 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10018 __Pyx_GIVEREF(__pyx_t_5);
10019 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10020 __Pyx_GIVEREF(__pyx_t_3);
10021 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10033 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10034 __Pyx_GOTREF(__pyx_t_3);
10035 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10044 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10045 __Pyx_GOTREF(__pyx_t_5);
10046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10047 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10048 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
10058 __pyx_v_result->data = __pyx_v_buf;
10069 __Pyx_XDECREF(((PyObject *)__pyx_r));
10070 __Pyx_INCREF(((PyObject *)__pyx_v_result));
10071 __pyx_r = __pyx_v_result;
10084 __Pyx_XDECREF(__pyx_t_2);
10085 __Pyx_XDECREF(__pyx_t_3);
10086 __Pyx_XDECREF(__pyx_t_4);
10087 __Pyx_XDECREF(__pyx_t_5);
10088 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10091 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10092 __Pyx_XGIVEREF((PyObject *)__pyx_r);
10093 __Pyx_TraceReturn(__pyx_r, 0);
10094 __Pyx_RefNannyFinishContext();
10107 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10108 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10109 PyObject *__pyx_v_name = 0;
10110 int __pyx_lineno = 0;
10111 const char *__pyx_filename = NULL;
10112 int __pyx_clineno = 0;
10114 __Pyx_RefNannyDeclarations
10115 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
10117 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10118 PyObject* values[1] = {0};
10119 if (unlikely(__pyx_kwds)) {
10120 Py_ssize_t kw_args;
10121 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10122 switch (pos_args) {
10123 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10124 CYTHON_FALLTHROUGH;
10126 default:
goto __pyx_L5_argtuple_error;
10128 kw_args = PyDict_Size(__pyx_kwds);
10129 switch (pos_args) {
10131 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10132 else goto __pyx_L5_argtuple_error;
10134 if (unlikely(kw_args > 0)) {
10135 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10137 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10138 goto __pyx_L5_argtuple_error;
10140 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10142 __pyx_v_name = values[0];
10144 goto __pyx_L4_argument_unpacking_done;
10145 __pyx_L5_argtuple_error:;
10146 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10148 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10149 __Pyx_RefNannyFinishContext();
10151 __pyx_L4_argument_unpacking_done:;
10152 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10155 __Pyx_RefNannyFinishContext();
10159 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10161 __Pyx_TraceDeclarations
10162 __Pyx_RefNannyDeclarations
10163 int __pyx_lineno = 0;
10164 const char *__pyx_filename = NULL;
10165 int __pyx_clineno = 0;
10166 __Pyx_RefNannySetupContext(
"__init__", 0);
10167 __Pyx_TraceCall(
"__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
10176 __Pyx_INCREF(__pyx_v_name);
10177 __Pyx_GIVEREF(__pyx_v_name);
10178 __Pyx_GOTREF(__pyx_v_self->name);
10179 __Pyx_DECREF(__pyx_v_self->name);
10180 __pyx_v_self->name = __pyx_v_name;
10194 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10197 __Pyx_TraceReturn(Py_None, 0);
10198 __Pyx_RefNannyFinishContext();
10211 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10212 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10213 PyObject *__pyx_r = 0;
10214 __Pyx_RefNannyDeclarations
10215 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10216 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10219 __Pyx_RefNannyFinishContext();
10223 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10224 PyObject *__pyx_r = NULL;
10225 __Pyx_TraceDeclarations
10226 __Pyx_RefNannyDeclarations
10227 int __pyx_lineno = 0;
10228 const char *__pyx_filename = NULL;
10229 int __pyx_clineno = 0;
10230 __Pyx_RefNannySetupContext(
"__repr__", 0);
10231 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
10240 __Pyx_XDECREF(__pyx_r);
10241 __Pyx_INCREF(__pyx_v_self->name);
10242 __pyx_r = __pyx_v_self->name;
10255 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10258 __Pyx_XGIVEREF(__pyx_r);
10259 __Pyx_TraceReturn(__pyx_r, 0);
10260 __Pyx_RefNannyFinishContext();
10271 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10272 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
10273 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10274 PyObject *__pyx_r = 0;
10275 __Pyx_RefNannyDeclarations
10276 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10277 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10280 __Pyx_RefNannyFinishContext();
10284 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10285 PyObject *__pyx_v_state = 0;
10286 PyObject *__pyx_v__dict = 0;
10287 int __pyx_v_use_setstate;
10288 PyObject *__pyx_r = NULL;
10289 __Pyx_TraceDeclarations
10290 __Pyx_RefNannyDeclarations
10291 PyObject *__pyx_t_1 = NULL;
10294 PyObject *__pyx_t_4 = NULL;
10295 PyObject *__pyx_t_5 = NULL;
10296 int __pyx_lineno = 0;
10297 const char *__pyx_filename = NULL;
10298 int __pyx_clineno = 0;
10299 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10300 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
10309 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10310 __Pyx_GOTREF(__pyx_t_1);
10311 __Pyx_INCREF(__pyx_v_self->name);
10312 __Pyx_GIVEREF(__pyx_v_self->name);
10313 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10314 __pyx_v_state = ((PyObject*)__pyx_t_1);
10324 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10325 __Pyx_GOTREF(__pyx_t_1);
10326 __pyx_v__dict = __pyx_t_1;
10336 __pyx_t_2 = (__pyx_v__dict != Py_None);
10337 __pyx_t_3 = (__pyx_t_2 != 0);
10347 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10348 __Pyx_GOTREF(__pyx_t_1);
10349 __Pyx_INCREF(__pyx_v__dict);
10350 __Pyx_GIVEREF(__pyx_v__dict);
10351 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10352 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10353 __Pyx_GOTREF(__pyx_t_4);
10354 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10355 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10365 __pyx_v_use_setstate = 1;
10385 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10386 __pyx_v_use_setstate = __pyx_t_3;
10397 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10407 __Pyx_XDECREF(__pyx_r);
10408 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10409 __Pyx_GOTREF(__pyx_t_4);
10410 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10411 __Pyx_GOTREF(__pyx_t_1);
10412 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10413 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10414 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10415 __Pyx_INCREF(__pyx_int_184977713);
10416 __Pyx_GIVEREF(__pyx_int_184977713);
10417 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10418 __Pyx_INCREF(Py_None);
10419 __Pyx_GIVEREF(Py_None);
10420 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10421 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10422 __Pyx_GOTREF(__pyx_t_5);
10423 __Pyx_GIVEREF(__pyx_t_4);
10424 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10425 __Pyx_GIVEREF(__pyx_t_1);
10426 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10427 __Pyx_INCREF(__pyx_v_state);
10428 __Pyx_GIVEREF(__pyx_v_state);
10429 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10432 __pyx_r = __pyx_t_5;
10453 __Pyx_XDECREF(__pyx_r);
10454 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10455 __Pyx_GOTREF(__pyx_t_5);
10456 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10457 __Pyx_GOTREF(__pyx_t_1);
10458 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10459 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10460 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10461 __Pyx_INCREF(__pyx_int_184977713);
10462 __Pyx_GIVEREF(__pyx_int_184977713);
10463 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10464 __Pyx_INCREF(__pyx_v_state);
10465 __Pyx_GIVEREF(__pyx_v_state);
10466 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10467 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10468 __Pyx_GOTREF(__pyx_t_4);
10469 __Pyx_GIVEREF(__pyx_t_5);
10470 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10471 __Pyx_GIVEREF(__pyx_t_1);
10472 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10475 __pyx_r = __pyx_t_4;
10488 __Pyx_XDECREF(__pyx_t_1);
10489 __Pyx_XDECREF(__pyx_t_4);
10490 __Pyx_XDECREF(__pyx_t_5);
10491 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10494 __Pyx_XDECREF(__pyx_v_state);
10495 __Pyx_XDECREF(__pyx_v__dict);
10496 __Pyx_XGIVEREF(__pyx_r);
10497 __Pyx_TraceReturn(__pyx_r, 0);
10498 __Pyx_RefNannyFinishContext();
10510 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10511 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10512 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10513 PyObject *__pyx_r = 0;
10514 __Pyx_RefNannyDeclarations
10515 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10516 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10519 __Pyx_RefNannyFinishContext();
10523 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10524 PyObject *__pyx_r = NULL;
10525 __Pyx_TraceDeclarations
10526 __Pyx_RefNannyDeclarations
10527 PyObject *__pyx_t_1 = NULL;
10528 int __pyx_lineno = 0;
10529 const char *__pyx_filename = NULL;
10530 int __pyx_clineno = 0;
10531 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10532 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
10539 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10540 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10541 __Pyx_GOTREF(__pyx_t_1);
10542 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10552 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10555 __Pyx_XDECREF(__pyx_t_1);
10556 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10559 __Pyx_XGIVEREF(__pyx_r);
10560 __Pyx_TraceReturn(__pyx_r, 0);
10561 __Pyx_RefNannyFinishContext();
10573 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10574 Py_intptr_t __pyx_v_aligned_p;
10575 size_t __pyx_v_offset;
10577 __Pyx_TraceDeclarations
10579 int __pyx_lineno = 0;
10580 const char *__pyx_filename = NULL;
10581 int __pyx_clineno = 0;
10582 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
10591 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10600 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10609 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10619 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10637 __pyx_r = ((
void *)__pyx_v_aligned_p);
10650 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
10653 __Pyx_TraceReturn(Py_None, 1);
10666 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10667 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10668 PyObject *__pyx_v_obj = 0;
10670 int __pyx_v_dtype_is_object;
10671 int __pyx_lineno = 0;
10672 const char *__pyx_filename = NULL;
10673 int __pyx_clineno = 0;
10675 __Pyx_RefNannyDeclarations
10676 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10678 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10679 PyObject* values[3] = {0,0,0};
10680 if (unlikely(__pyx_kwds)) {
10681 Py_ssize_t kw_args;
10682 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10683 switch (pos_args) {
10684 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10685 CYTHON_FALLTHROUGH;
10686 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10687 CYTHON_FALLTHROUGH;
10688 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10689 CYTHON_FALLTHROUGH;
10691 default:
goto __pyx_L5_argtuple_error;
10693 kw_args = PyDict_Size(__pyx_kwds);
10694 switch (pos_args) {
10696 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10697 else goto __pyx_L5_argtuple_error;
10698 CYTHON_FALLTHROUGH;
10700 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10702 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10704 CYTHON_FALLTHROUGH;
10707 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10708 if (value) { values[2] = value; kw_args--; }
10711 if (unlikely(kw_args > 0)) {
10712 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10715 switch (PyTuple_GET_SIZE(__pyx_args)) {
10716 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10717 CYTHON_FALLTHROUGH;
10718 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10719 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10721 default:
goto __pyx_L5_argtuple_error;
10724 __pyx_v_obj = values[0];
10725 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10727 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10729 __pyx_v_dtype_is_object = ((int)0);
10732 goto __pyx_L4_argument_unpacking_done;
10733 __pyx_L5_argtuple_error:;
10734 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10736 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10737 __Pyx_RefNannyFinishContext();
10739 __pyx_L4_argument_unpacking_done:;
10740 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10743 __Pyx_RefNannyFinishContext();
10747 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
10749 __Pyx_TraceDeclarations
10750 __Pyx_RefNannyDeclarations
10755 int __pyx_lineno = 0;
10756 const char *__pyx_filename = NULL;
10757 int __pyx_clineno = 0;
10758 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10759 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
10768 __Pyx_INCREF(__pyx_v_obj);
10769 __Pyx_GIVEREF(__pyx_v_obj);
10770 __Pyx_GOTREF(__pyx_v_self->obj);
10771 __Pyx_DECREF(__pyx_v_self->obj);
10772 __pyx_v_self->obj = __pyx_v_obj;
10781 __pyx_v_self->flags = __pyx_v_flags;
10790 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10791 __pyx_t_3 = (__pyx_t_2 != 0);
10794 __pyx_t_1 = __pyx_t_3;
10795 goto __pyx_L4_bool_binop_done;
10797 __pyx_t_3 = (__pyx_v_obj != Py_None);
10798 __pyx_t_2 = (__pyx_t_3 != 0);
10799 __pyx_t_1 = __pyx_t_2;
10800 __pyx_L4_bool_binop_done:;
10810 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10819 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10829 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10838 Py_INCREF(Py_None);
10865 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10875 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10884 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10902 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10912 __pyx_v_self->lock = PyThread_allocate_lock();
10921 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10922 if (unlikely(__pyx_t_1)) {
10931 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10958 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10968 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10971 __pyx_t_1 = __pyx_t_2;
10972 goto __pyx_L11_bool_binop_done;
10974 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10975 __pyx_t_1 = __pyx_t_2;
10976 __pyx_L11_bool_binop_done:;
10977 __pyx_v_self->dtype_is_object = __pyx_t_1;
10997 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11008 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11017 __pyx_v_self->typeinfo = NULL;
11031 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11034 __Pyx_TraceReturn(Py_None, 0);
11035 __Pyx_RefNannyFinishContext();
11048 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
11049 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11050 __Pyx_RefNannyDeclarations
11051 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
11052 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11055 __Pyx_RefNannyFinishContext();
11058 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11060 __Pyx_TraceDeclarations
11061 __Pyx_RefNannyDeclarations
11067 PyThread_type_lock __pyx_t_6;
11068 PyThread_type_lock __pyx_t_7;
11069 int __pyx_lineno = 0;
11070 const char *__pyx_filename = NULL;
11071 int __pyx_clineno = 0;
11072 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
11073 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
11082 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11083 __pyx_t_2 = (__pyx_t_1 != 0);
11093 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11112 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11122 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11131 Py_DECREF(Py_None);
11150 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11160 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11161 __pyx_t_4 = __pyx_t_3;
11162 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11163 __pyx_v_i = __pyx_t_5;
11172 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11182 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11191 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11201 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11202 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11211 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11212 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11230 goto __pyx_L6_break;
11250 PyThread_free_lock(__pyx_v_self->lock);
11274 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11276 __Pyx_TraceReturn(Py_None, 0);
11277 __Pyx_RefNannyFinishContext();
11288 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11289 Py_ssize_t __pyx_v_dim;
11290 char *__pyx_v_itemp;
11291 PyObject *__pyx_v_idx = NULL;
11293 __Pyx_TraceDeclarations
11294 __Pyx_RefNannyDeclarations
11295 Py_ssize_t __pyx_t_1;
11296 PyObject *__pyx_t_2 = NULL;
11297 Py_ssize_t __pyx_t_3;
11298 PyObject *(*__pyx_t_4)(PyObject *);
11299 PyObject *__pyx_t_5 = NULL;
11300 Py_ssize_t __pyx_t_6;
11302 int __pyx_lineno = 0;
11303 const char *__pyx_filename = NULL;
11304 int __pyx_clineno = 0;
11305 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11306 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
11315 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11325 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11326 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11329 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11330 __Pyx_GOTREF(__pyx_t_2);
11331 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11334 if (likely(!__pyx_t_4)) {
11335 if (likely(PyList_CheckExact(__pyx_t_2))) {
11336 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11337 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11338 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11340 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11341 __Pyx_GOTREF(__pyx_t_5);
11344 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11345 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11346 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11348 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11349 __Pyx_GOTREF(__pyx_t_5);
11353 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11354 if (unlikely(!__pyx_t_5)) {
11355 PyObject* exc_type = PyErr_Occurred();
11357 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11358 else __PYX_ERR(1, 397, __pyx_L1_error)
11362 __Pyx_GOTREF(__pyx_t_5);
11364 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11366 __pyx_v_dim = __pyx_t_1;
11367 __pyx_t_1 = (__pyx_t_1 + 1);
11376 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11377 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11378 __pyx_v_itemp = __pyx_t_7;
11388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11397 __pyx_r = __pyx_v_itemp;
11410 __Pyx_XDECREF(__pyx_t_2);
11411 __Pyx_XDECREF(__pyx_t_5);
11412 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11415 __Pyx_XDECREF(__pyx_v_idx);
11416 __Pyx_TraceReturn(Py_None, 0);
11417 __Pyx_RefNannyFinishContext();
11430 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11431 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11432 PyObject *__pyx_r = 0;
11433 __Pyx_RefNannyDeclarations
11434 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11435 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11438 __Pyx_RefNannyFinishContext();
11442 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11443 PyObject *__pyx_v_have_slices = NULL;
11444 PyObject *__pyx_v_indices = NULL;
11445 char *__pyx_v_itemp;
11446 PyObject *__pyx_r = NULL;
11447 __Pyx_TraceDeclarations
11448 __Pyx_RefNannyDeclarations
11451 PyObject *__pyx_t_3 = NULL;
11452 PyObject *__pyx_t_4 = NULL;
11453 PyObject *__pyx_t_5 = NULL;
11455 int __pyx_lineno = 0;
11456 const char *__pyx_filename = NULL;
11457 int __pyx_clineno = 0;
11458 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11459 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
11468 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11469 __pyx_t_2 = (__pyx_t_1 != 0);
11479 __Pyx_XDECREF(__pyx_r);
11480 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11481 __pyx_r = ((PyObject *)__pyx_v_self);
11500 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11501 __Pyx_GOTREF(__pyx_t_3);
11502 if (likely(__pyx_t_3 != Py_None)) {
11503 PyObject* sequence = __pyx_t_3;
11504 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11505 if (unlikely(size != 2)) {
11506 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11507 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11508 __PYX_ERR(1, 407, __pyx_L1_error)
11510 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11511 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11512 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11513 __Pyx_INCREF(__pyx_t_4);
11514 __Pyx_INCREF(__pyx_t_5);
11516 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11517 __Pyx_GOTREF(__pyx_t_4);
11518 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11519 __Pyx_GOTREF(__pyx_t_5);
11521 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11523 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11525 __pyx_v_have_slices = __pyx_t_4;
11527 __pyx_v_indices = __pyx_t_5;
11537 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11547 __Pyx_XDECREF(__pyx_r);
11548 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11549 __Pyx_GOTREF(__pyx_t_3);
11550 __pyx_r = __pyx_t_3;
11571 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11572 __pyx_v_itemp = __pyx_t_6;
11581 __Pyx_XDECREF(__pyx_r);
11582 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11583 __Pyx_GOTREF(__pyx_t_3);
11584 __pyx_r = __pyx_t_3;
11599 __Pyx_XDECREF(__pyx_t_3);
11600 __Pyx_XDECREF(__pyx_t_4);
11601 __Pyx_XDECREF(__pyx_t_5);
11602 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11605 __Pyx_XDECREF(__pyx_v_have_slices);
11606 __Pyx_XDECREF(__pyx_v_indices);
11607 __Pyx_XGIVEREF(__pyx_r);
11608 __Pyx_TraceReturn(__pyx_r, 0);
11609 __Pyx_RefNannyFinishContext();
11622 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11623 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11625 __Pyx_RefNannyDeclarations
11626 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11627 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11630 __Pyx_RefNannyFinishContext();
11634 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11635 PyObject *__pyx_v_have_slices = NULL;
11636 PyObject *__pyx_v_obj = NULL;
11638 __Pyx_TraceDeclarations
11639 __Pyx_RefNannyDeclarations
11641 PyObject *__pyx_t_2 = NULL;
11642 PyObject *__pyx_t_3 = NULL;
11643 PyObject *__pyx_t_4 = NULL;
11644 int __pyx_lineno = 0;
11645 const char *__pyx_filename = NULL;
11646 int __pyx_clineno = 0;
11647 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11648 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
11649 __Pyx_INCREF(__pyx_v_index);
11658 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11659 if (unlikely(__pyx_t_1)) {
11668 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11669 __Pyx_GOTREF(__pyx_t_2);
11670 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11671 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11672 __PYX_ERR(1, 418, __pyx_L1_error)
11690 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11691 __Pyx_GOTREF(__pyx_t_2);
11692 if (likely(__pyx_t_2 != Py_None)) {
11693 PyObject* sequence = __pyx_t_2;
11694 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11695 if (unlikely(size != 2)) {
11696 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11697 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11698 __PYX_ERR(1, 420, __pyx_L1_error)
11700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11701 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11702 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11703 __Pyx_INCREF(__pyx_t_3);
11704 __Pyx_INCREF(__pyx_t_4);
11706 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11707 __Pyx_GOTREF(__pyx_t_3);
11708 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11709 __Pyx_GOTREF(__pyx_t_4);
11711 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11713 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11715 __pyx_v_have_slices = __pyx_t_3;
11717 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11727 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11737 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11738 __Pyx_GOTREF(__pyx_t_2);
11739 __pyx_v_obj = __pyx_t_2;
11749 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11759 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11760 __Pyx_GOTREF(__pyx_t_2);
11761 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11762 __Pyx_GOTREF(__pyx_t_4);
11763 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11764 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11784 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11785 __Pyx_GOTREF(__pyx_t_4);
11786 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11787 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11788 __Pyx_GOTREF(__pyx_t_2);
11789 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11790 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11812 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11813 __Pyx_GOTREF(__pyx_t_2);
11814 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11830 __Pyx_XDECREF(__pyx_t_2);
11831 __Pyx_XDECREF(__pyx_t_3);
11832 __Pyx_XDECREF(__pyx_t_4);
11833 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11836 __Pyx_XDECREF(__pyx_v_have_slices);
11837 __Pyx_XDECREF(__pyx_v_obj);
11838 __Pyx_XDECREF(__pyx_v_index);
11839 __Pyx_TraceReturn(Py_None, 0);
11840 __Pyx_RefNannyFinishContext();
11852 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11853 PyObject *__pyx_r = NULL;
11854 __Pyx_TraceDeclarations
11855 __Pyx_RefNannyDeclarations
11858 PyObject *__pyx_t_3 = NULL;
11859 PyObject *__pyx_t_4 = NULL;
11860 PyObject *__pyx_t_5 = NULL;
11861 PyObject *__pyx_t_6 = NULL;
11862 PyObject *__pyx_t_7 = NULL;
11863 PyObject *__pyx_t_8 = NULL;
11865 int __pyx_lineno = 0;
11866 const char *__pyx_filename = NULL;
11867 int __pyx_clineno = 0;
11868 __Pyx_RefNannySetupContext(
"is_slice", 0);
11869 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
11870 __Pyx_INCREF(__pyx_v_obj);
11879 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11880 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11891 __Pyx_PyThreadState_declare
11892 __Pyx_PyThreadState_assign
11893 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11894 __Pyx_XGOTREF(__pyx_t_3);
11895 __Pyx_XGOTREF(__pyx_t_4);
11896 __Pyx_XGOTREF(__pyx_t_5);
11906 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11907 __Pyx_GOTREF(__pyx_t_6);
11916 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11917 __Pyx_GOTREF(__pyx_t_7);
11926 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11927 __Pyx_GOTREF(__pyx_t_8);
11928 __Pyx_INCREF(__pyx_v_obj);
11929 __Pyx_GIVEREF(__pyx_v_obj);
11930 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11931 __Pyx_GIVEREF(__pyx_t_6);
11932 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11933 __Pyx_GIVEREF(__pyx_t_7);
11934 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11937 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11938 __Pyx_GOTREF(__pyx_t_7);
11939 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11940 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11951 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11952 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11953 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11954 goto __pyx_L9_try_end;
11956 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11957 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11958 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11967 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11969 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11970 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11971 __Pyx_GOTREF(__pyx_t_7);
11972 __Pyx_GOTREF(__pyx_t_8);
11973 __Pyx_GOTREF(__pyx_t_6);
11982 __Pyx_XDECREF(__pyx_r);
11983 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11984 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11985 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11986 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11987 goto __pyx_L7_except_return;
11989 goto __pyx_L6_except_error;
11990 __pyx_L6_except_error:;
11999 __Pyx_XGIVEREF(__pyx_t_3);
12000 __Pyx_XGIVEREF(__pyx_t_4);
12001 __Pyx_XGIVEREF(__pyx_t_5);
12002 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12003 goto __pyx_L1_error;
12004 __pyx_L7_except_return:;
12005 __Pyx_XGIVEREF(__pyx_t_3);
12006 __Pyx_XGIVEREF(__pyx_t_4);
12007 __Pyx_XGIVEREF(__pyx_t_5);
12008 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12029 __Pyx_XDECREF(__pyx_r);
12030 __Pyx_INCREF(__pyx_v_obj);
12031 __pyx_r = __pyx_v_obj;
12044 __Pyx_XDECREF(__pyx_t_6);
12045 __Pyx_XDECREF(__pyx_t_7);
12046 __Pyx_XDECREF(__pyx_t_8);
12047 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12050 __Pyx_XDECREF(__pyx_v_obj);
12051 __Pyx_XGIVEREF(__pyx_r);
12052 __Pyx_TraceReturn(__pyx_r, 0);
12053 __Pyx_RefNannyFinishContext();
12065 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12066 __Pyx_memviewslice __pyx_v_dst_slice;
12067 __Pyx_memviewslice __pyx_v_src_slice;
12068 PyObject *__pyx_r = NULL;
12069 __Pyx_TraceDeclarations
12070 __Pyx_RefNannyDeclarations
12071 __Pyx_memviewslice *__pyx_t_1;
12072 __Pyx_memviewslice *__pyx_t_2;
12073 PyObject *__pyx_t_3 = NULL;
12077 int __pyx_lineno = 0;
12078 const char *__pyx_filename = NULL;
12079 int __pyx_clineno = 0;
12080 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
12081 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
12090 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
12091 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
12100 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
12101 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
12110 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12111 __Pyx_GOTREF(__pyx_t_3);
12112 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12113 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12114 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12115 __Pyx_GOTREF(__pyx_t_3);
12116 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12117 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12126 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
12137 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12140 __Pyx_XDECREF(__pyx_t_3);
12141 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12144 __Pyx_XGIVEREF(__pyx_r);
12145 __Pyx_TraceReturn(__pyx_r, 0);
12146 __Pyx_RefNannyFinishContext();
12158 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12159 int __pyx_v_array[0x80];
12161 void *__pyx_v_item;
12162 __Pyx_memviewslice *__pyx_v_dst_slice;
12163 __Pyx_memviewslice __pyx_v_tmp_slice;
12164 PyObject *__pyx_r = NULL;
12165 __Pyx_TraceDeclarations
12166 __Pyx_RefNannyDeclarations
12167 __Pyx_memviewslice *__pyx_t_1;
12169 PyObject *__pyx_t_3 = NULL;
12172 char const *__pyx_t_6;
12173 PyObject *__pyx_t_7 = NULL;
12174 PyObject *__pyx_t_8 = NULL;
12175 PyObject *__pyx_t_9 = NULL;
12176 PyObject *__pyx_t_10 = NULL;
12177 PyObject *__pyx_t_11 = NULL;
12178 PyObject *__pyx_t_12 = NULL;
12179 int __pyx_lineno = 0;
12180 const char *__pyx_filename = NULL;
12181 int __pyx_clineno = 0;
12182 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12183 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
12192 __pyx_v_tmp = NULL;
12201 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
12202 __pyx_v_dst_slice = __pyx_t_1;
12211 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
12221 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12230 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12231 if (unlikely(__pyx_t_2)) {
12240 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12258 __pyx_v_item = __pyx_v_tmp;
12278 __pyx_v_item = ((
void *)__pyx_v_array);
12298 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12308 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12328 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12329 __Pyx_GOTREF(__pyx_t_3);
12330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12341 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12351 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12352 __Pyx_GOTREF(__pyx_t_3);
12353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12371 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12383 PyMem_Free(__pyx_v_tmp);
12388 __Pyx_PyThreadState_declare
12389 __Pyx_PyThreadState_assign
12390 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12391 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12392 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12393 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12394 __Pyx_XGOTREF(__pyx_t_7);
12395 __Pyx_XGOTREF(__pyx_t_8);
12396 __Pyx_XGOTREF(__pyx_t_9);
12397 __Pyx_XGOTREF(__pyx_t_10);
12398 __Pyx_XGOTREF(__pyx_t_11);
12399 __Pyx_XGOTREF(__pyx_t_12);
12400 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12402 PyMem_Free(__pyx_v_tmp);
12404 if (PY_MAJOR_VERSION >= 3) {
12405 __Pyx_XGIVEREF(__pyx_t_10);
12406 __Pyx_XGIVEREF(__pyx_t_11);
12407 __Pyx_XGIVEREF(__pyx_t_12);
12408 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12410 __Pyx_XGIVEREF(__pyx_t_7);
12411 __Pyx_XGIVEREF(__pyx_t_8);
12412 __Pyx_XGIVEREF(__pyx_t_9);
12413 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12414 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12415 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12416 goto __pyx_L1_error;
12430 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12433 __Pyx_XDECREF(__pyx_t_3);
12434 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12437 __Pyx_XGIVEREF(__pyx_r);
12438 __Pyx_TraceReturn(__pyx_r, 0);
12439 __Pyx_RefNannyFinishContext();
12451 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12452 char *__pyx_v_itemp;
12453 PyObject *__pyx_r = NULL;
12454 __Pyx_TraceDeclarations
12455 __Pyx_RefNannyDeclarations
12457 PyObject *__pyx_t_2 = NULL;
12458 int __pyx_lineno = 0;
12459 const char *__pyx_filename = NULL;
12460 int __pyx_clineno = 0;
12461 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12462 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
12471 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12472 __pyx_v_itemp = __pyx_t_1;
12481 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12482 __Pyx_GOTREF(__pyx_t_2);
12483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12494 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12497 __Pyx_XDECREF(__pyx_t_2);
12498 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12501 __Pyx_XGIVEREF(__pyx_r);
12502 __Pyx_TraceReturn(__pyx_r, 0);
12503 __Pyx_RefNannyFinishContext();
12515 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12516 PyObject *__pyx_v_struct = NULL;
12517 PyObject *__pyx_v_bytesitem = 0;
12518 PyObject *__pyx_v_result = NULL;
12519 PyObject *__pyx_r = NULL;
12520 __Pyx_TraceDeclarations
12521 __Pyx_RefNannyDeclarations
12522 PyObject *__pyx_t_1 = NULL;
12523 PyObject *__pyx_t_2 = NULL;
12524 PyObject *__pyx_t_3 = NULL;
12525 PyObject *__pyx_t_4 = NULL;
12526 PyObject *__pyx_t_5 = NULL;
12527 PyObject *__pyx_t_6 = NULL;
12528 PyObject *__pyx_t_7 = NULL;
12530 PyObject *__pyx_t_9 = NULL;
12533 int __pyx_lineno = 0;
12534 const char *__pyx_filename = NULL;
12535 int __pyx_clineno = 0;
12536 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12537 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
12546 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12547 __Pyx_GOTREF(__pyx_t_1);
12548 __pyx_v_struct = __pyx_t_1;
12558 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12559 __Pyx_GOTREF(__pyx_t_1);
12560 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12571 __Pyx_PyThreadState_declare
12572 __Pyx_PyThreadState_assign
12573 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12574 __Pyx_XGOTREF(__pyx_t_2);
12575 __Pyx_XGOTREF(__pyx_t_3);
12576 __Pyx_XGOTREF(__pyx_t_4);
12586 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12587 __Pyx_GOTREF(__pyx_t_5);
12588 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12589 __Pyx_GOTREF(__pyx_t_6);
12592 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12593 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12594 if (likely(__pyx_t_7)) {
12595 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12596 __Pyx_INCREF(__pyx_t_7);
12597 __Pyx_INCREF(
function);
12598 __Pyx_DECREF_SET(__pyx_t_5,
function);
12602 #if CYTHON_FAST_PYCALL
12603 if (PyFunction_Check(__pyx_t_5)) {
12604 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12605 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12606 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12607 __Pyx_GOTREF(__pyx_t_1);
12608 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12611 #if CYTHON_FAST_PYCCALL
12612 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12613 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12614 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12615 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12616 __Pyx_GOTREF(__pyx_t_1);
12617 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12621 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12622 __Pyx_GOTREF(__pyx_t_9);
12624 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12626 __Pyx_GIVEREF(__pyx_t_6);
12627 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12628 __Pyx_INCREF(__pyx_v_bytesitem);
12629 __Pyx_GIVEREF(__pyx_v_bytesitem);
12630 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12632 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12633 __Pyx_GOTREF(__pyx_t_1);
12634 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12636 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12637 __pyx_v_result = __pyx_t_1;
12657 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12658 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12668 __Pyx_XDECREF(__pyx_r);
12669 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12670 __Pyx_GOTREF(__pyx_t_1);
12671 __pyx_r = __pyx_t_1;
12673 goto __pyx_L6_except_return;
12691 __Pyx_XDECREF(__pyx_r);
12692 __Pyx_INCREF(__pyx_v_result);
12693 __pyx_r = __pyx_v_result;
12694 goto __pyx_L6_except_return;
12697 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12698 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12699 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12700 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12701 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12710 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12711 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12712 __Pyx_GOTREF(__pyx_t_6);
12713 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12714 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12715 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12716 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12718 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12719 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12720 __Pyx_GOTREF(__pyx_t_9);
12721 __Pyx_GOTREF(__pyx_t_5);
12722 __Pyx_GOTREF(__pyx_t_1);
12731 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12732 __Pyx_GOTREF(__pyx_t_6);
12733 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12734 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12735 __PYX_ERR(1, 495, __pyx_L5_except_error)
12737 goto __pyx_L5_except_error;
12738 __pyx_L5_except_error:;
12747 __Pyx_XGIVEREF(__pyx_t_2);
12748 __Pyx_XGIVEREF(__pyx_t_3);
12749 __Pyx_XGIVEREF(__pyx_t_4);
12750 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12751 goto __pyx_L1_error;
12752 __pyx_L6_except_return:;
12753 __Pyx_XGIVEREF(__pyx_t_2);
12754 __Pyx_XGIVEREF(__pyx_t_3);
12755 __Pyx_XGIVEREF(__pyx_t_4);
12756 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12770 __Pyx_XDECREF(__pyx_t_1);
12771 __Pyx_XDECREF(__pyx_t_5);
12772 __Pyx_XDECREF(__pyx_t_6);
12773 __Pyx_XDECREF(__pyx_t_7);
12774 __Pyx_XDECREF(__pyx_t_9);
12775 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12778 __Pyx_XDECREF(__pyx_v_struct);
12779 __Pyx_XDECREF(__pyx_v_bytesitem);
12780 __Pyx_XDECREF(__pyx_v_result);
12781 __Pyx_XGIVEREF(__pyx_r);
12782 __Pyx_TraceReturn(__pyx_r, 0);
12783 __Pyx_RefNannyFinishContext();
12795 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12796 PyObject *__pyx_v_struct = NULL;
12798 PyObject *__pyx_v_bytesvalue = 0;
12799 Py_ssize_t __pyx_v_i;
12800 PyObject *__pyx_r = NULL;
12801 __Pyx_TraceDeclarations
12802 __Pyx_RefNannyDeclarations
12803 PyObject *__pyx_t_1 = NULL;
12806 PyObject *__pyx_t_4 = NULL;
12807 PyObject *__pyx_t_5 = NULL;
12808 PyObject *__pyx_t_6 = NULL;
12810 PyObject *__pyx_t_8 = NULL;
12811 Py_ssize_t __pyx_t_9;
12812 PyObject *__pyx_t_10 = NULL;
12817 int __pyx_lineno = 0;
12818 const char *__pyx_filename = NULL;
12819 int __pyx_clineno = 0;
12820 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12821 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
12830 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12831 __Pyx_GOTREF(__pyx_t_1);
12832 __pyx_v_struct = __pyx_t_1;
12842 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12843 __pyx_t_3 = (__pyx_t_2 != 0);
12853 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12854 __Pyx_GOTREF(__pyx_t_1);
12855 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12856 __Pyx_GOTREF(__pyx_t_4);
12857 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12858 __Pyx_GOTREF(__pyx_t_5);
12859 __Pyx_GIVEREF(__pyx_t_4);
12860 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12862 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12863 __Pyx_GOTREF(__pyx_t_4);
12864 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12865 __Pyx_GOTREF(__pyx_t_6);
12866 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12867 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12868 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12869 __Pyx_GOTREF(__pyx_t_4);
12870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12871 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12872 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12873 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12894 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12895 __Pyx_GOTREF(__pyx_t_6);
12896 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12897 __Pyx_GOTREF(__pyx_t_1);
12900 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12901 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12902 if (likely(__pyx_t_5)) {
12903 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12904 __Pyx_INCREF(__pyx_t_5);
12905 __Pyx_INCREF(
function);
12906 __Pyx_DECREF_SET(__pyx_t_6,
function);
12910 #if CYTHON_FAST_PYCALL
12911 if (PyFunction_Check(__pyx_t_6)) {
12912 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12913 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12914 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12915 __Pyx_GOTREF(__pyx_t_4);
12916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12919 #if CYTHON_FAST_PYCCALL
12920 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12921 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12922 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12923 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12924 __Pyx_GOTREF(__pyx_t_4);
12925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12929 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12930 __Pyx_GOTREF(__pyx_t_8);
12932 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12934 __Pyx_GIVEREF(__pyx_t_1);
12935 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12936 __Pyx_INCREF(__pyx_v_value);
12937 __Pyx_GIVEREF(__pyx_v_value);
12938 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12940 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12941 __Pyx_GOTREF(__pyx_t_4);
12942 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12944 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12945 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12946 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12959 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12960 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12961 __PYX_ERR(1, 514, __pyx_L1_error)
12963 __Pyx_INCREF(__pyx_v_bytesvalue);
12964 __pyx_t_10 = __pyx_v_bytesvalue;
12965 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12966 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12967 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12968 __pyx_t_11 = __pyx_t_14;
12969 __pyx_v_c = (__pyx_t_11[0]);
12978 __pyx_v_i = __pyx_t_9;
12987 __pyx_t_9 = (__pyx_t_9 + 1);
12996 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12998 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13009 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13012 __Pyx_XDECREF(__pyx_t_1);
13013 __Pyx_XDECREF(__pyx_t_4);
13014 __Pyx_XDECREF(__pyx_t_5);
13015 __Pyx_XDECREF(__pyx_t_6);
13016 __Pyx_XDECREF(__pyx_t_8);
13017 __Pyx_XDECREF(__pyx_t_10);
13018 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13021 __Pyx_XDECREF(__pyx_v_struct);
13022 __Pyx_XDECREF(__pyx_v_bytesvalue);
13023 __Pyx_XGIVEREF(__pyx_r);
13024 __Pyx_TraceReturn(__pyx_r, 0);
13025 __Pyx_RefNannyFinishContext();
13038 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13039 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13041 __Pyx_RefNannyDeclarations
13042 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13043 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
13046 __Pyx_RefNannyFinishContext();
13050 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13052 __Pyx_TraceDeclarations
13053 __Pyx_RefNannyDeclarations
13056 PyObject *__pyx_t_3 = NULL;
13057 Py_ssize_t *__pyx_t_4;
13061 Py_ssize_t __pyx_t_8;
13062 int __pyx_lineno = 0;
13063 const char *__pyx_filename = NULL;
13064 int __pyx_clineno = 0;
13065 if (__pyx_v_info == NULL) {
13066 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13069 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13070 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13071 __Pyx_GIVEREF(__pyx_v_info->obj);
13072 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
13081 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13084 __pyx_t_1 = __pyx_t_2;
13085 goto __pyx_L4_bool_binop_done;
13087 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13088 __pyx_t_1 = __pyx_t_2;
13089 __pyx_L4_bool_binop_done:;
13090 if (unlikely(__pyx_t_1)) {
13099 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13100 __Pyx_GOTREF(__pyx_t_3);
13101 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13103 __PYX_ERR(1, 520, __pyx_L1_error)
13121 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13131 __pyx_t_4 = __pyx_v_self->view.shape;
13132 __pyx_v_info->shape = __pyx_t_4;
13152 __pyx_v_info->shape = NULL;
13163 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13173 __pyx_t_4 = __pyx_v_self->view.strides;
13174 __pyx_v_info->strides = __pyx_t_4;
13194 __pyx_v_info->strides = NULL;
13205 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13215 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13216 __pyx_v_info->suboffsets = __pyx_t_4;
13236 __pyx_v_info->suboffsets = NULL;
13247 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13257 __pyx_t_5 = __pyx_v_self->view.format;
13258 __pyx_v_info->format = __pyx_t_5;
13278 __pyx_v_info->format = NULL;
13289 __pyx_t_6 = __pyx_v_self->view.buf;
13290 __pyx_v_info->buf = __pyx_t_6;
13299 __pyx_t_7 = __pyx_v_self->view.ndim;
13300 __pyx_v_info->ndim = __pyx_t_7;
13309 __pyx_t_8 = __pyx_v_self->view.itemsize;
13310 __pyx_v_info->itemsize = __pyx_t_8;
13319 __pyx_t_8 = __pyx_v_self->view.len;
13320 __pyx_v_info->len = __pyx_t_8;
13329 __pyx_t_1 = __pyx_v_self->view.readonly;
13330 __pyx_v_info->readonly = __pyx_t_1;
13339 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13340 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13341 __Pyx_GOTREF(__pyx_v_info->obj);
13342 __Pyx_DECREF(__pyx_v_info->obj);
13343 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13357 __Pyx_XDECREF(__pyx_t_3);
13358 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13360 if (__pyx_v_info->obj != NULL) {
13361 __Pyx_GOTREF(__pyx_v_info->obj);
13362 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13366 if (__pyx_v_info->obj == Py_None) {
13367 __Pyx_GOTREF(__pyx_v_info->obj);
13368 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13371 __Pyx_TraceReturn(Py_None, 0);
13372 __Pyx_RefNannyFinishContext();
13385 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13386 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13387 PyObject *__pyx_r = 0;
13388 __Pyx_RefNannyDeclarations
13389 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13390 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13393 __Pyx_RefNannyFinishContext();
13397 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13398 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13399 PyObject *__pyx_r = NULL;
13400 __Pyx_TraceDeclarations
13401 __Pyx_RefNannyDeclarations
13402 PyObject *__pyx_t_1 = NULL;
13404 int __pyx_lineno = 0;
13405 const char *__pyx_filename = NULL;
13406 int __pyx_clineno = 0;
13407 __Pyx_RefNannySetupContext(
"__get__", 0);
13408 __Pyx_TraceCall(
"__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
13417 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13418 __Pyx_GOTREF(__pyx_t_1);
13419 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13420 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13430 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13439 __Pyx_XDECREF(__pyx_r);
13440 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13441 __pyx_r = ((PyObject *)__pyx_v_result);
13454 __Pyx_XDECREF(__pyx_t_1);
13455 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13458 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13459 __Pyx_XGIVEREF(__pyx_r);
13460 __Pyx_TraceReturn(__pyx_r, 0);
13461 __Pyx_RefNannyFinishContext();
13474 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13475 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13476 PyObject *__pyx_r = 0;
13477 __Pyx_RefNannyDeclarations
13478 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13479 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13482 __Pyx_RefNannyFinishContext();
13486 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13487 PyObject *__pyx_r = NULL;
13488 __Pyx_TraceDeclarations
13489 __Pyx_RefNannyDeclarations
13490 int __pyx_lineno = 0;
13491 const char *__pyx_filename = NULL;
13492 int __pyx_clineno = 0;
13493 __Pyx_RefNannySetupContext(
"__get__", 0);
13494 __Pyx_TraceCall(
"__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
13503 __Pyx_XDECREF(__pyx_r);
13504 __Pyx_INCREF(__pyx_v_self->obj);
13505 __pyx_r = __pyx_v_self->obj;
13518 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13521 __Pyx_XGIVEREF(__pyx_r);
13522 __Pyx_TraceReturn(__pyx_r, 0);
13523 __Pyx_RefNannyFinishContext();
13536 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13537 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13538 PyObject *__pyx_r = 0;
13539 __Pyx_RefNannyDeclarations
13540 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13541 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13544 __Pyx_RefNannyFinishContext();
13548 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13549 Py_ssize_t __pyx_v_length;
13550 PyObject *__pyx_r = NULL;
13551 __Pyx_TraceDeclarations
13552 __Pyx_RefNannyDeclarations
13553 PyObject *__pyx_t_1 = NULL;
13554 Py_ssize_t *__pyx_t_2;
13555 Py_ssize_t *__pyx_t_3;
13556 Py_ssize_t *__pyx_t_4;
13557 PyObject *__pyx_t_5 = NULL;
13558 int __pyx_lineno = 0;
13559 const char *__pyx_filename = NULL;
13560 int __pyx_clineno = 0;
13561 __Pyx_RefNannySetupContext(
"__get__", 0);
13562 __Pyx_TraceCall(
"__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
13571 __Pyx_XDECREF(__pyx_r);
13572 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13573 __Pyx_GOTREF(__pyx_t_1);
13574 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13575 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13576 __pyx_t_2 = __pyx_t_4;
13577 __pyx_v_length = (__pyx_t_2[0]);
13578 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13579 __Pyx_GOTREF(__pyx_t_5);
13580 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13581 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13583 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13584 __Pyx_GOTREF(__pyx_t_5);
13585 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13586 __pyx_r = __pyx_t_5;
13600 __Pyx_XDECREF(__pyx_t_1);
13601 __Pyx_XDECREF(__pyx_t_5);
13602 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13605 __Pyx_XGIVEREF(__pyx_r);
13606 __Pyx_TraceReturn(__pyx_r, 0);
13607 __Pyx_RefNannyFinishContext();
13620 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13621 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13622 PyObject *__pyx_r = 0;
13623 __Pyx_RefNannyDeclarations
13624 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13625 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13628 __Pyx_RefNannyFinishContext();
13632 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13633 Py_ssize_t __pyx_v_stride;
13634 PyObject *__pyx_r = NULL;
13635 __Pyx_TraceDeclarations
13636 __Pyx_RefNannyDeclarations
13638 PyObject *__pyx_t_2 = NULL;
13639 Py_ssize_t *__pyx_t_3;
13640 Py_ssize_t *__pyx_t_4;
13641 Py_ssize_t *__pyx_t_5;
13642 PyObject *__pyx_t_6 = NULL;
13643 int __pyx_lineno = 0;
13644 const char *__pyx_filename = NULL;
13645 int __pyx_clineno = 0;
13646 __Pyx_RefNannySetupContext(
"__get__", 0);
13647 __Pyx_TraceCall(
"__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
13656 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13657 if (unlikely(__pyx_t_1)) {
13666 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13667 __Pyx_GOTREF(__pyx_t_2);
13668 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13669 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13670 __PYX_ERR(1, 570, __pyx_L1_error)
13688 __Pyx_XDECREF(__pyx_r);
13689 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13690 __Pyx_GOTREF(__pyx_t_2);
13691 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13692 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13693 __pyx_t_3 = __pyx_t_5;
13694 __pyx_v_stride = (__pyx_t_3[0]);
13695 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13696 __Pyx_GOTREF(__pyx_t_6);
13697 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13698 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13700 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13701 __Pyx_GOTREF(__pyx_t_6);
13702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13703 __pyx_r = __pyx_t_6;
13717 __Pyx_XDECREF(__pyx_t_2);
13718 __Pyx_XDECREF(__pyx_t_6);
13719 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13722 __Pyx_XGIVEREF(__pyx_r);
13723 __Pyx_TraceReturn(__pyx_r, 0);
13724 __Pyx_RefNannyFinishContext();
13737 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13738 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13739 PyObject *__pyx_r = 0;
13740 __Pyx_RefNannyDeclarations
13741 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13742 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13745 __Pyx_RefNannyFinishContext();
13749 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13750 Py_ssize_t __pyx_v_suboffset;
13751 PyObject *__pyx_r = NULL;
13752 __Pyx_TraceDeclarations
13753 __Pyx_RefNannyDeclarations
13755 PyObject *__pyx_t_2 = NULL;
13756 PyObject *__pyx_t_3 = NULL;
13757 Py_ssize_t *__pyx_t_4;
13758 Py_ssize_t *__pyx_t_5;
13759 Py_ssize_t *__pyx_t_6;
13760 int __pyx_lineno = 0;
13761 const char *__pyx_filename = NULL;
13762 int __pyx_clineno = 0;
13763 __Pyx_RefNannySetupContext(
"__get__", 0);
13764 __Pyx_TraceCall(
"__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
13773 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13783 __Pyx_XDECREF(__pyx_r);
13784 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13785 __Pyx_GOTREF(__pyx_t_2);
13786 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__31, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13787 __Pyx_GOTREF(__pyx_t_3);
13788 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13789 __pyx_r = __pyx_t_3;
13809 __Pyx_XDECREF(__pyx_r);
13810 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13811 __Pyx_GOTREF(__pyx_t_3);
13812 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13813 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13814 __pyx_t_4 = __pyx_t_6;
13815 __pyx_v_suboffset = (__pyx_t_4[0]);
13816 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13817 __Pyx_GOTREF(__pyx_t_2);
13818 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13819 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13821 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13822 __Pyx_GOTREF(__pyx_t_2);
13823 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13824 __pyx_r = __pyx_t_2;
13838 __Pyx_XDECREF(__pyx_t_2);
13839 __Pyx_XDECREF(__pyx_t_3);
13840 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13843 __Pyx_XGIVEREF(__pyx_r);
13844 __Pyx_TraceReturn(__pyx_r, 0);
13845 __Pyx_RefNannyFinishContext();
13858 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13859 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13860 PyObject *__pyx_r = 0;
13861 __Pyx_RefNannyDeclarations
13862 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13863 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13866 __Pyx_RefNannyFinishContext();
13870 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13871 PyObject *__pyx_r = NULL;
13872 __Pyx_TraceDeclarations
13873 __Pyx_RefNannyDeclarations
13874 PyObject *__pyx_t_1 = NULL;
13875 int __pyx_lineno = 0;
13876 const char *__pyx_filename = NULL;
13877 int __pyx_clineno = 0;
13878 __Pyx_RefNannySetupContext(
"__get__", 0);
13879 __Pyx_TraceCall(
"__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
13888 __Pyx_XDECREF(__pyx_r);
13889 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13890 __Pyx_GOTREF(__pyx_t_1);
13891 __pyx_r = __pyx_t_1;
13905 __Pyx_XDECREF(__pyx_t_1);
13906 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13909 __Pyx_XGIVEREF(__pyx_r);
13910 __Pyx_TraceReturn(__pyx_r, 0);
13911 __Pyx_RefNannyFinishContext();
13924 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13925 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13926 PyObject *__pyx_r = 0;
13927 __Pyx_RefNannyDeclarations
13928 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13929 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13932 __Pyx_RefNannyFinishContext();
13936 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13937 PyObject *__pyx_r = NULL;
13938 __Pyx_TraceDeclarations
13939 __Pyx_RefNannyDeclarations
13940 PyObject *__pyx_t_1 = NULL;
13941 int __pyx_lineno = 0;
13942 const char *__pyx_filename = NULL;
13943 int __pyx_clineno = 0;
13944 __Pyx_RefNannySetupContext(
"__get__", 0);
13945 __Pyx_TraceCall(
"__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
13954 __Pyx_XDECREF(__pyx_r);
13955 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13956 __Pyx_GOTREF(__pyx_t_1);
13957 __pyx_r = __pyx_t_1;
13971 __Pyx_XDECREF(__pyx_t_1);
13972 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13975 __Pyx_XGIVEREF(__pyx_r);
13976 __Pyx_TraceReturn(__pyx_r, 0);
13977 __Pyx_RefNannyFinishContext();
13990 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13991 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13992 PyObject *__pyx_r = 0;
13993 __Pyx_RefNannyDeclarations
13994 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13995 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13998 __Pyx_RefNannyFinishContext();
14002 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14003 PyObject *__pyx_r = NULL;
14004 __Pyx_TraceDeclarations
14005 __Pyx_RefNannyDeclarations
14006 PyObject *__pyx_t_1 = NULL;
14007 PyObject *__pyx_t_2 = NULL;
14008 PyObject *__pyx_t_3 = NULL;
14009 int __pyx_lineno = 0;
14010 const char *__pyx_filename = NULL;
14011 int __pyx_clineno = 0;
14012 __Pyx_RefNannySetupContext(
"__get__", 0);
14013 __Pyx_TraceCall(
"__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
14022 __Pyx_XDECREF(__pyx_r);
14023 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
14024 __Pyx_GOTREF(__pyx_t_1);
14025 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
14026 __Pyx_GOTREF(__pyx_t_2);
14027 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
14028 __Pyx_GOTREF(__pyx_t_3);
14029 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14030 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14031 __pyx_r = __pyx_t_3;
14045 __Pyx_XDECREF(__pyx_t_1);
14046 __Pyx_XDECREF(__pyx_t_2);
14047 __Pyx_XDECREF(__pyx_t_3);
14048 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14051 __Pyx_XGIVEREF(__pyx_r);
14052 __Pyx_TraceReturn(__pyx_r, 0);
14053 __Pyx_RefNannyFinishContext();
14066 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
14067 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14068 PyObject *__pyx_r = 0;
14069 __Pyx_RefNannyDeclarations
14070 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14071 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14074 __Pyx_RefNannyFinishContext();
14078 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14079 PyObject *__pyx_v_result = NULL;
14080 PyObject *__pyx_v_length = NULL;
14081 PyObject *__pyx_r = NULL;
14082 __Pyx_TraceDeclarations
14083 __Pyx_RefNannyDeclarations
14086 Py_ssize_t *__pyx_t_3;
14087 Py_ssize_t *__pyx_t_4;
14088 Py_ssize_t *__pyx_t_5;
14089 PyObject *__pyx_t_6 = NULL;
14090 int __pyx_lineno = 0;
14091 const char *__pyx_filename = NULL;
14092 int __pyx_clineno = 0;
14093 __Pyx_RefNannySetupContext(
"__get__", 0);
14094 __Pyx_TraceCall(
"__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
14103 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14104 __pyx_t_2 = (__pyx_t_1 != 0);
14114 __Pyx_INCREF(__pyx_int_1);
14115 __pyx_v_result = __pyx_int_1;
14124 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14125 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14126 __pyx_t_3 = __pyx_t_5;
14127 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14128 __Pyx_GOTREF(__pyx_t_6);
14129 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14139 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14140 __Pyx_GOTREF(__pyx_t_6);
14141 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14152 __Pyx_INCREF(__pyx_v_result);
14153 __Pyx_GIVEREF(__pyx_v_result);
14154 __Pyx_GOTREF(__pyx_v_self->_size);
14155 __Pyx_DECREF(__pyx_v_self->_size);
14156 __pyx_v_self->_size = __pyx_v_result;
14174 __Pyx_XDECREF(__pyx_r);
14175 __Pyx_INCREF(__pyx_v_self->_size);
14176 __pyx_r = __pyx_v_self->_size;
14189 __Pyx_XDECREF(__pyx_t_6);
14190 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14193 __Pyx_XDECREF(__pyx_v_result);
14194 __Pyx_XDECREF(__pyx_v_length);
14195 __Pyx_XGIVEREF(__pyx_r);
14196 __Pyx_TraceReturn(__pyx_r, 0);
14197 __Pyx_RefNannyFinishContext();
14210 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
14211 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14212 Py_ssize_t __pyx_r;
14213 __Pyx_RefNannyDeclarations
14214 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
14215 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14218 __Pyx_RefNannyFinishContext();
14222 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14223 Py_ssize_t __pyx_r;
14224 __Pyx_TraceDeclarations
14225 __Pyx_RefNannyDeclarations
14227 int __pyx_lineno = 0;
14228 const char *__pyx_filename = NULL;
14229 int __pyx_clineno = 0;
14230 __Pyx_RefNannySetupContext(
"__len__", 0);
14231 __Pyx_TraceCall(
"__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
14240 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14250 __pyx_r = (__pyx_v_self->view.shape[0]);
14282 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14285 __Pyx_TraceReturn(Py_None, 0);
14286 __Pyx_RefNannyFinishContext();
14299 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
14300 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14301 PyObject *__pyx_r = 0;
14302 __Pyx_RefNannyDeclarations
14303 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
14304 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14307 __Pyx_RefNannyFinishContext();
14311 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14312 PyObject *__pyx_r = NULL;
14313 __Pyx_TraceDeclarations
14314 __Pyx_RefNannyDeclarations
14315 PyObject *__pyx_t_1 = NULL;
14316 PyObject *__pyx_t_2 = NULL;
14317 PyObject *__pyx_t_3 = NULL;
14318 int __pyx_lineno = 0;
14319 const char *__pyx_filename = NULL;
14320 int __pyx_clineno = 0;
14321 __Pyx_RefNannySetupContext(
"__repr__", 0);
14322 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
14331 __Pyx_XDECREF(__pyx_r);
14332 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14333 __Pyx_GOTREF(__pyx_t_1);
14334 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14335 __Pyx_GOTREF(__pyx_t_2);
14336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14337 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14338 __Pyx_GOTREF(__pyx_t_1);
14339 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14348 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14349 __Pyx_GOTREF(__pyx_t_2);
14358 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14359 __Pyx_GOTREF(__pyx_t_3);
14360 __Pyx_GIVEREF(__pyx_t_1);
14361 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14362 __Pyx_GIVEREF(__pyx_t_2);
14363 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14366 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14367 __Pyx_GOTREF(__pyx_t_2);
14368 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14369 __pyx_r = __pyx_t_2;
14383 __Pyx_XDECREF(__pyx_t_1);
14384 __Pyx_XDECREF(__pyx_t_2);
14385 __Pyx_XDECREF(__pyx_t_3);
14386 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14389 __Pyx_XGIVEREF(__pyx_r);
14390 __Pyx_TraceReturn(__pyx_r, 0);
14391 __Pyx_RefNannyFinishContext();
14404 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14405 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14406 PyObject *__pyx_r = 0;
14407 __Pyx_RefNannyDeclarations
14408 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14409 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14412 __Pyx_RefNannyFinishContext();
14416 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14417 PyObject *__pyx_r = NULL;
14418 __Pyx_TraceDeclarations
14419 __Pyx_RefNannyDeclarations
14420 PyObject *__pyx_t_1 = NULL;
14421 PyObject *__pyx_t_2 = NULL;
14422 int __pyx_lineno = 0;
14423 const char *__pyx_filename = NULL;
14424 int __pyx_clineno = 0;
14425 __Pyx_RefNannySetupContext(
"__str__", 0);
14426 __Pyx_TraceCall(
"__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
14435 __Pyx_XDECREF(__pyx_r);
14436 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14437 __Pyx_GOTREF(__pyx_t_1);
14438 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14439 __Pyx_GOTREF(__pyx_t_2);
14440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14441 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14442 __Pyx_GOTREF(__pyx_t_1);
14443 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14444 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14445 __Pyx_GOTREF(__pyx_t_2);
14446 __Pyx_GIVEREF(__pyx_t_1);
14447 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14449 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14450 __Pyx_GOTREF(__pyx_t_1);
14451 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14452 __pyx_r = __pyx_t_1;
14466 __Pyx_XDECREF(__pyx_t_1);
14467 __Pyx_XDECREF(__pyx_t_2);
14468 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14471 __Pyx_XGIVEREF(__pyx_r);
14472 __Pyx_TraceReturn(__pyx_r, 0);
14473 __Pyx_RefNannyFinishContext();
14486 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14487 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14488 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14489 PyObject *__pyx_r = 0;
14490 __Pyx_RefNannyDeclarations
14491 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14492 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14495 __Pyx_RefNannyFinishContext();
14499 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14500 __Pyx_memviewslice *__pyx_v_mslice;
14501 __Pyx_memviewslice __pyx_v_tmp;
14502 PyObject *__pyx_r = NULL;
14503 __Pyx_TraceDeclarations
14504 __Pyx_RefNannyDeclarations
14505 __Pyx_memviewslice *__pyx_t_1;
14506 PyObject *__pyx_t_2 = NULL;
14507 int __pyx_lineno = 0;
14508 const char *__pyx_filename = NULL;
14509 int __pyx_clineno = 0;
14510 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14511 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
14520 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14521 __pyx_v_mslice = __pyx_t_1;
14530 __Pyx_XDECREF(__pyx_r);
14531 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14532 __Pyx_GOTREF(__pyx_t_2);
14533 __pyx_r = __pyx_t_2;
14547 __Pyx_XDECREF(__pyx_t_2);
14548 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14551 __Pyx_XGIVEREF(__pyx_r);
14552 __Pyx_TraceReturn(__pyx_r, 0);
14553 __Pyx_RefNannyFinishContext();
14566 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14567 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14568 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14569 PyObject *__pyx_r = 0;
14570 __Pyx_RefNannyDeclarations
14571 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14572 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14575 __Pyx_RefNannyFinishContext();
14579 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14580 __Pyx_memviewslice *__pyx_v_mslice;
14581 __Pyx_memviewslice __pyx_v_tmp;
14582 PyObject *__pyx_r = NULL;
14583 __Pyx_TraceDeclarations
14584 __Pyx_RefNannyDeclarations
14585 __Pyx_memviewslice *__pyx_t_1;
14586 PyObject *__pyx_t_2 = NULL;
14587 int __pyx_lineno = 0;
14588 const char *__pyx_filename = NULL;
14589 int __pyx_clineno = 0;
14590 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14591 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
14600 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14601 __pyx_v_mslice = __pyx_t_1;
14610 __Pyx_XDECREF(__pyx_r);
14611 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14612 __Pyx_GOTREF(__pyx_t_2);
14613 __pyx_r = __pyx_t_2;
14627 __Pyx_XDECREF(__pyx_t_2);
14628 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14631 __Pyx_XGIVEREF(__pyx_r);
14632 __Pyx_TraceReturn(__pyx_r, 0);
14633 __Pyx_RefNannyFinishContext();
14646 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14647 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14648 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14649 PyObject *__pyx_r = 0;
14650 __Pyx_RefNannyDeclarations
14651 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14652 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14655 __Pyx_RefNannyFinishContext();
14659 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14660 __Pyx_memviewslice __pyx_v_mslice;
14662 PyObject *__pyx_r = NULL;
14663 __Pyx_TraceDeclarations
14664 __Pyx_RefNannyDeclarations
14665 __Pyx_memviewslice __pyx_t_1;
14666 PyObject *__pyx_t_2 = NULL;
14667 int __pyx_lineno = 0;
14668 const char *__pyx_filename = NULL;
14669 int __pyx_clineno = 0;
14670 __Pyx_RefNannySetupContext(
"copy", 0);
14671 __Pyx_TraceCall(
"copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
14680 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14689 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14698 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14699 __pyx_v_mslice = __pyx_t_1;
14708 __Pyx_XDECREF(__pyx_r);
14709 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14710 __Pyx_GOTREF(__pyx_t_2);
14711 __pyx_r = __pyx_t_2;
14725 __Pyx_XDECREF(__pyx_t_2);
14726 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14729 __Pyx_XGIVEREF(__pyx_r);
14730 __Pyx_TraceReturn(__pyx_r, 0);
14731 __Pyx_RefNannyFinishContext();
14744 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14745 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14746 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14747 PyObject *__pyx_r = 0;
14748 __Pyx_RefNannyDeclarations
14749 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14750 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14753 __Pyx_RefNannyFinishContext();
14757 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14758 __Pyx_memviewslice __pyx_v_src;
14759 __Pyx_memviewslice __pyx_v_dst;
14761 PyObject *__pyx_r = NULL;
14762 __Pyx_TraceDeclarations
14763 __Pyx_RefNannyDeclarations
14764 __Pyx_memviewslice __pyx_t_1;
14765 PyObject *__pyx_t_2 = NULL;
14766 int __pyx_lineno = 0;
14767 const char *__pyx_filename = NULL;
14768 int __pyx_clineno = 0;
14769 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14770 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
14779 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14788 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14797 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14798 __pyx_v_dst = __pyx_t_1;
14807 __Pyx_XDECREF(__pyx_r);
14808 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14809 __Pyx_GOTREF(__pyx_t_2);
14810 __pyx_r = __pyx_t_2;
14824 __Pyx_XDECREF(__pyx_t_2);
14825 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14828 __Pyx_XGIVEREF(__pyx_r);
14829 __Pyx_TraceReturn(__pyx_r, 0);
14830 __Pyx_RefNannyFinishContext();
14841 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14842 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14843 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14844 PyObject *__pyx_r = 0;
14845 __Pyx_RefNannyDeclarations
14846 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14847 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14850 __Pyx_RefNannyFinishContext();
14854 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14855 PyObject *__pyx_r = NULL;
14856 __Pyx_TraceDeclarations
14857 __Pyx_RefNannyDeclarations
14858 PyObject *__pyx_t_1 = NULL;
14859 int __pyx_lineno = 0;
14860 const char *__pyx_filename = NULL;
14861 int __pyx_clineno = 0;
14862 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14863 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14871 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14872 __Pyx_GOTREF(__pyx_t_1);
14873 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14874 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14875 __PYX_ERR(1, 2, __pyx_L1_error)
14885 __Pyx_XDECREF(__pyx_t_1);
14886 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14888 __Pyx_XGIVEREF(__pyx_r);
14889 __Pyx_TraceReturn(__pyx_r, 0);
14890 __Pyx_RefNannyFinishContext();
14902 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14903 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14904 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14905 PyObject *__pyx_r = 0;
14906 __Pyx_RefNannyDeclarations
14907 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14908 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14911 __Pyx_RefNannyFinishContext();
14915 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14916 PyObject *__pyx_r = NULL;
14917 __Pyx_TraceDeclarations
14918 __Pyx_RefNannyDeclarations
14919 PyObject *__pyx_t_1 = NULL;
14920 int __pyx_lineno = 0;
14921 const char *__pyx_filename = NULL;
14922 int __pyx_clineno = 0;
14923 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14924 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14931 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14932 __Pyx_GOTREF(__pyx_t_1);
14933 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14934 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14935 __PYX_ERR(1, 4, __pyx_L1_error)
14946 __Pyx_XDECREF(__pyx_t_1);
14947 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14949 __Pyx_XGIVEREF(__pyx_r);
14950 __Pyx_TraceReturn(__pyx_r, 0);
14951 __Pyx_RefNannyFinishContext();
14963 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14964 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14965 PyObject *__pyx_r = NULL;
14966 __Pyx_TraceDeclarations
14967 __Pyx_RefNannyDeclarations
14968 PyObject *__pyx_t_1 = NULL;
14969 PyObject *__pyx_t_2 = NULL;
14970 PyObject *__pyx_t_3 = NULL;
14971 int __pyx_lineno = 0;
14972 const char *__pyx_filename = NULL;
14973 int __pyx_clineno = 0;
14974 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14975 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
14984 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14985 __Pyx_GOTREF(__pyx_t_1);
14986 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14987 __Pyx_GOTREF(__pyx_t_2);
14988 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14989 __Pyx_GOTREF(__pyx_t_3);
14990 __Pyx_INCREF(__pyx_v_o);
14991 __Pyx_GIVEREF(__pyx_v_o);
14992 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14993 __Pyx_GIVEREF(__pyx_t_1);
14994 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14995 __Pyx_GIVEREF(__pyx_t_2);
14996 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14999 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15000 __Pyx_GOTREF(__pyx_t_2);
15001 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15002 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
15012 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15021 __Pyx_XDECREF(__pyx_r);
15022 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15023 __pyx_r = ((PyObject *)__pyx_v_result);
15036 __Pyx_XDECREF(__pyx_t_1);
15037 __Pyx_XDECREF(__pyx_t_2);
15038 __Pyx_XDECREF(__pyx_t_3);
15039 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15042 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15043 __Pyx_XGIVEREF(__pyx_r);
15044 __Pyx_TraceReturn(__pyx_r, 0);
15045 __Pyx_RefNannyFinishContext();
15057 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15059 __Pyx_TraceDeclarations
15060 __Pyx_RefNannyDeclarations
15062 int __pyx_lineno = 0;
15063 const char *__pyx_filename = NULL;
15064 int __pyx_clineno = 0;
15065 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
15066 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
15075 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15076 __pyx_r = __pyx_t_1;
15089 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15092 __Pyx_TraceReturn(Py_None, 0);
15093 __Pyx_RefNannyFinishContext();
15105 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
15106 PyObject *__pyx_v_tup = NULL;
15107 PyObject *__pyx_v_result = NULL;
15108 int __pyx_v_have_slices;
15109 int __pyx_v_seen_ellipsis;
15110 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15111 PyObject *__pyx_v_item = NULL;
15112 Py_ssize_t __pyx_v_nslices;
15113 PyObject *__pyx_r = NULL;
15114 __Pyx_TraceDeclarations
15115 __Pyx_RefNannyDeclarations
15118 PyObject *__pyx_t_3 = NULL;
15119 PyObject *__pyx_t_4 = NULL;
15120 Py_ssize_t __pyx_t_5;
15121 PyObject *(*__pyx_t_6)(PyObject *);
15122 PyObject *__pyx_t_7 = NULL;
15123 Py_ssize_t __pyx_t_8;
15126 PyObject *__pyx_t_11 = NULL;
15127 int __pyx_lineno = 0;
15128 const char *__pyx_filename = NULL;
15129 int __pyx_clineno = 0;
15130 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
15131 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
15140 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15141 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15151 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15152 __Pyx_GOTREF(__pyx_t_3);
15153 __Pyx_INCREF(__pyx_v_index);
15154 __Pyx_GIVEREF(__pyx_v_index);
15155 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15156 __pyx_v_tup = __pyx_t_3;
15177 __Pyx_INCREF(__pyx_v_index);
15178 __pyx_v_tup = __pyx_v_index;
15189 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15190 __Pyx_GOTREF(__pyx_t_3);
15191 __pyx_v_result = ((PyObject*)__pyx_t_3);
15201 __pyx_v_have_slices = 0;
15210 __pyx_v_seen_ellipsis = 0;
15219 __Pyx_INCREF(__pyx_int_0);
15220 __pyx_t_3 = __pyx_int_0;
15221 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15222 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15225 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15226 __Pyx_GOTREF(__pyx_t_4);
15227 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15230 if (likely(!__pyx_t_6)) {
15231 if (likely(PyList_CheckExact(__pyx_t_4))) {
15232 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15233 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15234 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15236 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15237 __Pyx_GOTREF(__pyx_t_7);
15240 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15241 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15242 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15244 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15245 __Pyx_GOTREF(__pyx_t_7);
15249 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15250 if (unlikely(!__pyx_t_7)) {
15251 PyObject* exc_type = PyErr_Occurred();
15253 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15254 else __PYX_ERR(1, 679, __pyx_L1_error)
15258 __Pyx_GOTREF(__pyx_t_7);
15260 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15262 __Pyx_INCREF(__pyx_t_3);
15263 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15264 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15265 __Pyx_GOTREF(__pyx_t_7);
15266 __Pyx_DECREF(__pyx_t_3);
15267 __pyx_t_3 = __pyx_t_7;
15277 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15278 __pyx_t_1 = (__pyx_t_2 != 0);
15288 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15298 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15299 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
15300 __Pyx_GOTREF(__pyx_t_7);
15301 { Py_ssize_t __pyx_temp;
15302 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15303 __Pyx_INCREF(__pyx_slice__7);
15304 __Pyx_GIVEREF(__pyx_slice__7);
15305 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
15308 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15309 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15318 __pyx_v_seen_ellipsis = 1;
15338 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15349 __pyx_v_have_slices = 1;
15369 __pyx_t_2 = PySlice_Check(__pyx_v_item);
15370 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15373 __pyx_t_1 = __pyx_t_10;
15374 goto __pyx_L9_bool_binop_done;
15376 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15377 __pyx_t_1 = __pyx_t_10;
15378 __pyx_L9_bool_binop_done:;
15379 if (unlikely(__pyx_t_1)) {
15388 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15389 __Pyx_GOTREF(__pyx_t_7);
15390 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15391 __Pyx_GOTREF(__pyx_t_11);
15392 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15393 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15394 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15395 __PYX_ERR(1, 689, __pyx_L1_error)
15413 __pyx_t_10 = (__pyx_v_have_slices != 0);
15416 __pyx_t_1 = __pyx_t_10;
15417 goto __pyx_L11_bool_binop_done;
15419 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15420 __pyx_t_2 = (__pyx_t_10 != 0);
15421 __pyx_t_1 = __pyx_t_2;
15422 __pyx_L11_bool_binop_done:;
15423 __pyx_v_have_slices = __pyx_t_1;
15432 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15444 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15445 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15454 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15455 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15464 __pyx_t_1 = (__pyx_v_nslices != 0);
15474 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15475 __Pyx_GOTREF(__pyx_t_3);
15476 { Py_ssize_t __pyx_temp;
15477 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15478 __Pyx_INCREF(__pyx_slice__7);
15479 __Pyx_GIVEREF(__pyx_slice__7);
15480 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
15483 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15502 __Pyx_XDECREF(__pyx_r);
15503 if (!__pyx_v_have_slices) {
15505 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15506 __Pyx_GOTREF(__pyx_t_4);
15507 __pyx_t_3 = __pyx_t_4;
15509 goto __pyx_L14_bool_binop_done;
15511 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15512 __Pyx_GOTREF(__pyx_t_4);
15513 __pyx_t_3 = __pyx_t_4;
15515 __pyx_L14_bool_binop_done:;
15516 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15517 __Pyx_GOTREF(__pyx_t_4);
15518 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15519 __Pyx_GOTREF(__pyx_t_11);
15520 __Pyx_GIVEREF(__pyx_t_3);
15521 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15522 __Pyx_GIVEREF(__pyx_t_4);
15523 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15526 __pyx_r = ((PyObject*)__pyx_t_11);
15540 __Pyx_XDECREF(__pyx_t_3);
15541 __Pyx_XDECREF(__pyx_t_4);
15542 __Pyx_XDECREF(__pyx_t_7);
15543 __Pyx_XDECREF(__pyx_t_11);
15544 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15547 __Pyx_XDECREF(__pyx_v_tup);
15548 __Pyx_XDECREF(__pyx_v_result);
15549 __Pyx_XDECREF(__pyx_v_idx);
15550 __Pyx_XDECREF(__pyx_v_item);
15551 __Pyx_XGIVEREF(__pyx_r);
15552 __Pyx_TraceReturn(__pyx_r, 0);
15553 __Pyx_RefNannyFinishContext();
15565 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15566 Py_ssize_t __pyx_v_suboffset;
15567 PyObject *__pyx_r = NULL;
15568 __Pyx_TraceDeclarations
15569 __Pyx_RefNannyDeclarations
15570 Py_ssize_t *__pyx_t_1;
15571 Py_ssize_t *__pyx_t_2;
15572 Py_ssize_t *__pyx_t_3;
15574 PyObject *__pyx_t_5 = NULL;
15575 int __pyx_lineno = 0;
15576 const char *__pyx_filename = NULL;
15577 int __pyx_clineno = 0;
15578 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15579 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
15588 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15589 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15590 __pyx_t_1 = __pyx_t_3;
15591 __pyx_v_suboffset = (__pyx_t_1[0]);
15600 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15601 if (unlikely(__pyx_t_4)) {
15610 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15611 __Pyx_GOTREF(__pyx_t_5);
15612 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15613 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15614 __PYX_ERR(1, 703, __pyx_L1_error)
15635 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15638 __Pyx_XDECREF(__pyx_t_5);
15639 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15642 __Pyx_XGIVEREF(__pyx_r);
15643 __Pyx_TraceReturn(__pyx_r, 0);
15644 __Pyx_RefNannyFinishContext();
15656 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15657 int __pyx_v_new_ndim;
15658 int __pyx_v_suboffset_dim;
15660 __Pyx_memviewslice __pyx_v_src;
15661 __Pyx_memviewslice __pyx_v_dst;
15662 __Pyx_memviewslice *__pyx_v_p_src;
15663 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15664 __Pyx_memviewslice *__pyx_v_p_dst;
15665 int *__pyx_v_p_suboffset_dim;
15666 Py_ssize_t __pyx_v_start;
15667 Py_ssize_t __pyx_v_stop;
15668 Py_ssize_t __pyx_v_step;
15669 int __pyx_v_have_start;
15670 int __pyx_v_have_stop;
15671 int __pyx_v_have_step;
15672 PyObject *__pyx_v_index = NULL;
15673 struct __pyx_memoryview_obj *__pyx_r = NULL;
15674 __Pyx_TraceDeclarations
15675 __Pyx_RefNannyDeclarations
15678 PyObject *__pyx_t_3 = NULL;
15679 struct __pyx_memoryview_obj *__pyx_t_4;
15682 Py_ssize_t __pyx_t_7;
15683 PyObject *(*__pyx_t_8)(PyObject *);
15684 PyObject *__pyx_t_9 = NULL;
15685 Py_ssize_t __pyx_t_10;
15687 Py_ssize_t __pyx_t_12;
15688 int __pyx_lineno = 0;
15689 const char *__pyx_filename = NULL;
15690 int __pyx_clineno = 0;
15691 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15692 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
15701 __pyx_v_new_ndim = 0;
15702 __pyx_v_suboffset_dim = -1;
15711 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15720 #ifndef CYTHON_WITHOUT_ASSERTIONS
15721 if (unlikely(!Py_OptimizeFlag)) {
15722 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15723 PyErr_SetNone(PyExc_AssertionError);
15724 __PYX_ERR(1, 722, __pyx_L1_error)
15736 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15737 __pyx_t_2 = (__pyx_t_1 != 0);
15747 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15748 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15749 __Pyx_INCREF(__pyx_t_3);
15750 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15760 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15780 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15789 __pyx_v_p_src = (&__pyx_v_src);
15800 __pyx_t_4 = __pyx_v_p_src->memview;
15801 __pyx_v_dst.memview = __pyx_t_4;
15810 __pyx_t_5 = __pyx_v_p_src->data;
15811 __pyx_v_dst.data = __pyx_t_5;
15820 __pyx_v_p_dst = (&__pyx_v_dst);
15829 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15839 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15840 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15843 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15844 __Pyx_GOTREF(__pyx_t_3);
15845 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15848 if (likely(!__pyx_t_8)) {
15849 if (likely(PyList_CheckExact(__pyx_t_3))) {
15850 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15851 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15852 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15854 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15855 __Pyx_GOTREF(__pyx_t_9);
15858 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15859 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15860 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15862 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15863 __Pyx_GOTREF(__pyx_t_9);
15867 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15868 if (unlikely(!__pyx_t_9)) {
15869 PyObject* exc_type = PyErr_Occurred();
15871 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15872 else __PYX_ERR(1, 746, __pyx_L1_error)
15876 __Pyx_GOTREF(__pyx_t_9);
15878 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15880 __pyx_v_dim = __pyx_t_6;
15881 __pyx_t_6 = (__pyx_t_6 + 1);
15890 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15900 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15909 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15928 __pyx_t_2 = (__pyx_v_index == Py_None);
15929 __pyx_t_1 = (__pyx_t_2 != 0);
15939 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15948 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15957 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15966 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15986 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15987 __Pyx_GOTREF(__pyx_t_9);
15988 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15990 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15992 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15993 __pyx_t_10 = __pyx_t_12;
15994 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15995 goto __pyx_L7_bool_binop_done;
15998 __pyx_L7_bool_binop_done:;
15999 __pyx_v_start = __pyx_t_10;
16008 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16009 __Pyx_GOTREF(__pyx_t_9);
16010 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
16012 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16014 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
16015 __pyx_t_10 = __pyx_t_12;
16016 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16017 goto __pyx_L9_bool_binop_done;
16020 __pyx_L9_bool_binop_done:;
16021 __pyx_v_stop = __pyx_t_10;
16030 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16031 __Pyx_GOTREF(__pyx_t_9);
16032 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
16034 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16036 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
16037 __pyx_t_10 = __pyx_t_12;
16038 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16039 goto __pyx_L11_bool_binop_done;
16042 __pyx_L11_bool_binop_done:;
16043 __pyx_v_step = __pyx_t_10;
16052 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
16053 __Pyx_GOTREF(__pyx_t_9);
16054 __pyx_t_1 = (__pyx_t_9 != Py_None);
16055 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16056 __pyx_v_have_start = __pyx_t_1;
16065 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
16066 __Pyx_GOTREF(__pyx_t_9);
16067 __pyx_t_1 = (__pyx_t_9 != Py_None);
16068 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16069 __pyx_v_have_stop = __pyx_t_1;
16078 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
16079 __Pyx_GOTREF(__pyx_t_9);
16080 __pyx_t_1 = (__pyx_t_9 != Py_None);
16081 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16082 __pyx_v_have_step = __pyx_t_1;
16091 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
16100 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16112 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16121 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16122 __pyx_t_2 = (__pyx_t_1 != 0);
16132 __Pyx_XDECREF(((PyObject *)__pyx_r));
16141 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16150 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16159 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16160 __Pyx_GOTREF(__pyx_t_3);
16161 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16162 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16183 __Pyx_XDECREF(((PyObject *)__pyx_r));
16192 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16193 __Pyx_GOTREF(__pyx_t_3);
16202 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16203 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16218 __Pyx_XDECREF(__pyx_t_3);
16219 __Pyx_XDECREF(__pyx_t_9);
16220 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16223 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16224 __Pyx_XDECREF(__pyx_v_index);
16225 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16226 __Pyx_TraceReturn(__pyx_r, 0);
16227 __Pyx_RefNannyFinishContext();
16239 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
16240 Py_ssize_t __pyx_v_new_shape;
16241 int __pyx_v_negative_step;
16243 __Pyx_TraceDeclarations
16247 int __pyx_lineno = 0;
16248 const char *__pyx_filename = NULL;
16249 int __pyx_clineno = 0;
16250 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
16259 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16269 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16279 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16297 __pyx_t_1 = (0 <= __pyx_v_start);
16299 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16301 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16311 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
16340 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16343 __pyx_t_2 = __pyx_t_1;
16344 goto __pyx_L6_bool_binop_done;
16346 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16347 __pyx_t_2 = __pyx_t_1;
16348 __pyx_L6_bool_binop_done:;
16349 __pyx_v_negative_step = __pyx_t_2;
16358 __pyx_t_1 = (__pyx_v_have_step != 0);
16361 __pyx_t_2 = __pyx_t_1;
16362 goto __pyx_L9_bool_binop_done;
16364 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16365 __pyx_t_2 = __pyx_t_1;
16366 __pyx_L9_bool_binop_done:;
16376 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
16394 __pyx_t_2 = (__pyx_v_have_start != 0);
16404 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16414 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16423 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16461 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16471 __pyx_t_2 = (__pyx_v_negative_step != 0);
16481 __pyx_v_start = (__pyx_v_shape - 1);
16501 __pyx_v_start = __pyx_v_shape;
16533 __pyx_t_2 = (__pyx_v_negative_step != 0);
16543 __pyx_v_start = (__pyx_v_shape - 1);
16576 __pyx_t_2 = (__pyx_v_have_stop != 0);
16586 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16596 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16605 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16643 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16653 __pyx_v_stop = __pyx_v_shape;
16683 __pyx_t_2 = (__pyx_v_negative_step != 0);
16693 __pyx_v_stop = -1
L;
16713 __pyx_v_stop = __pyx_v_shape;
16726 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16754 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16763 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16773 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16791 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16801 __pyx_v_new_shape = 0;
16819 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16828 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16837 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16848 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16858 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16878 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16879 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16890 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16900 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16910 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16920 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16948 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16970 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17005 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17007 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17009 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17014 __Pyx_TraceReturn(Py_None, 1);
17026 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17027 Py_ssize_t __pyx_v_shape;
17028 Py_ssize_t __pyx_v_stride;
17029 Py_ssize_t __pyx_v_suboffset;
17030 Py_ssize_t __pyx_v_itemsize;
17031 char *__pyx_v_resultp;
17033 __Pyx_TraceDeclarations
17034 __Pyx_RefNannyDeclarations
17035 Py_ssize_t __pyx_t_1;
17037 PyObject *__pyx_t_3 = NULL;
17038 PyObject *__pyx_t_4 = NULL;
17039 int __pyx_lineno = 0;
17040 const char *__pyx_filename = NULL;
17041 int __pyx_clineno = 0;
17042 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
17043 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
17052 __pyx_v_suboffset = -1
L;
17061 __pyx_t_1 = __pyx_v_view->itemsize;
17062 __pyx_v_itemsize = __pyx_t_1;
17071 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17081 if (unlikely(__pyx_v_itemsize == 0)) {
17082 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
17083 __PYX_ERR(1, 917, __pyx_L1_error)
17085 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17086 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
17087 __PYX_ERR(1, 917, __pyx_L1_error)
17089 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17098 __pyx_v_stride = __pyx_v_itemsize;
17118 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17127 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17136 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17146 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17166 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17176 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17185 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17186 if (unlikely(__pyx_t_2)) {
17195 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17196 __Pyx_GOTREF(__pyx_t_3);
17197 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17198 __Pyx_GOTREF(__pyx_t_4);
17199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17200 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17201 __Pyx_GOTREF(__pyx_t_3);
17202 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17203 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17205 __PYX_ERR(1, 928, __pyx_L1_error)
17232 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17233 if (unlikely(__pyx_t_2)) {
17242 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17243 __Pyx_GOTREF(__pyx_t_3);
17244 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17245 __Pyx_GOTREF(__pyx_t_4);
17246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17247 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17248 __Pyx_GOTREF(__pyx_t_3);
17249 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17250 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17252 __PYX_ERR(1, 931, __pyx_L1_error)
17270 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17279 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17289 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17307 __pyx_r = __pyx_v_resultp;
17320 __Pyx_XDECREF(__pyx_t_3);
17321 __Pyx_XDECREF(__pyx_t_4);
17322 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17325 __Pyx_TraceReturn(Py_None, 0);
17326 __Pyx_RefNannyFinishContext();
17338 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17340 Py_ssize_t *__pyx_v_shape;
17341 Py_ssize_t *__pyx_v_strides;
17345 __Pyx_TraceDeclarations
17347 Py_ssize_t *__pyx_t_2;
17350 Py_ssize_t __pyx_t_5;
17351 Py_ssize_t __pyx_t_6;
17355 int __pyx_lineno = 0;
17356 const char *__pyx_filename = NULL;
17357 int __pyx_clineno = 0;
17358 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
17367 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17368 __pyx_v_ndim = __pyx_t_1;
17377 __pyx_t_2 = __pyx_v_memslice->shape;
17378 __pyx_v_shape = __pyx_t_2;
17387 __pyx_t_2 = __pyx_v_memslice->strides;
17388 __pyx_v_strides = __pyx_t_2;
17397 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17398 __pyx_t_4 = __pyx_t_3;
17399 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17400 __pyx_v_i = __pyx_t_1;
17409 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17418 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17419 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17420 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17421 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17430 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17431 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17432 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17433 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17442 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17445 __pyx_t_7 = __pyx_t_8;
17446 goto __pyx_L6_bool_binop_done;
17448 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17449 __pyx_t_7 = __pyx_t_8;
17450 __pyx_L6_bool_binop_done:;
17460 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17494 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17496 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17498 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17503 __Pyx_TraceReturn(Py_None, 1);
17516 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17517 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17518 __Pyx_RefNannyDeclarations
17519 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17520 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17523 __Pyx_RefNannyFinishContext();
17526 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17527 __Pyx_TraceDeclarations
17528 __Pyx_RefNannyDeclarations
17529 int __pyx_lineno = 0;
17530 const char *__pyx_filename = NULL;
17531 int __pyx_clineno = 0;
17532 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17533 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
17542 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17555 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17557 __Pyx_TraceReturn(Py_None, 0);
17558 __Pyx_RefNannyFinishContext();
17569 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17570 PyObject *__pyx_r = NULL;
17571 __Pyx_TraceDeclarations
17572 __Pyx_RefNannyDeclarations
17574 PyObject *__pyx_t_2 = NULL;
17575 int __pyx_lineno = 0;
17576 const char *__pyx_filename = NULL;
17577 int __pyx_clineno = 0;
17578 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17579 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
17588 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17598 __Pyx_XDECREF(__pyx_r);
17599 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17600 __Pyx_GOTREF(__pyx_t_2);
17601 __pyx_r = __pyx_t_2;
17622 __Pyx_XDECREF(__pyx_r);
17623 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17624 __Pyx_GOTREF(__pyx_t_2);
17625 __pyx_r = __pyx_t_2;
17640 __Pyx_XDECREF(__pyx_t_2);
17641 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17644 __Pyx_XGIVEREF(__pyx_r);
17645 __Pyx_TraceReturn(__pyx_r, 0);
17646 __Pyx_RefNannyFinishContext();
17658 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17659 PyObject *__pyx_r = NULL;
17660 __Pyx_TraceDeclarations
17661 __Pyx_RefNannyDeclarations
17664 PyObject *__pyx_t_3 = NULL;
17665 int __pyx_lineno = 0;
17666 const char *__pyx_filename = NULL;
17667 int __pyx_clineno = 0;
17668 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17669 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
17678 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17688 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17708 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17709 __Pyx_GOTREF(__pyx_t_3);
17710 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17723 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17726 __Pyx_XDECREF(__pyx_t_3);
17727 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17730 __Pyx_XGIVEREF(__pyx_r);
17731 __Pyx_TraceReturn(__pyx_r, 0);
17732 __Pyx_RefNannyFinishContext();
17745 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17746 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17747 PyObject *__pyx_r = 0;
17748 __Pyx_RefNannyDeclarations
17749 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17750 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17753 __Pyx_RefNannyFinishContext();
17757 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17758 PyObject *__pyx_r = NULL;
17759 __Pyx_TraceDeclarations
17760 __Pyx_RefNannyDeclarations
17761 int __pyx_lineno = 0;
17762 const char *__pyx_filename = NULL;
17763 int __pyx_clineno = 0;
17764 __Pyx_RefNannySetupContext(
"__get__", 0);
17765 __Pyx_TraceCall(
"__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
17774 __Pyx_XDECREF(__pyx_r);
17775 __Pyx_INCREF(__pyx_v_self->from_object);
17776 __pyx_r = __pyx_v_self->from_object;
17789 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17792 __Pyx_XGIVEREF(__pyx_r);
17793 __Pyx_TraceReturn(__pyx_r, 0);
17794 __Pyx_RefNannyFinishContext();
17805 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17806 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17807 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17808 PyObject *__pyx_r = 0;
17809 __Pyx_RefNannyDeclarations
17810 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17811 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17814 __Pyx_RefNannyFinishContext();
17818 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17819 PyObject *__pyx_r = NULL;
17820 __Pyx_TraceDeclarations
17821 __Pyx_RefNannyDeclarations
17822 PyObject *__pyx_t_1 = NULL;
17823 int __pyx_lineno = 0;
17824 const char *__pyx_filename = NULL;
17825 int __pyx_clineno = 0;
17826 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17827 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17835 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17836 __Pyx_GOTREF(__pyx_t_1);
17837 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17838 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17839 __PYX_ERR(1, 2, __pyx_L1_error)
17849 __Pyx_XDECREF(__pyx_t_1);
17850 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17852 __Pyx_XGIVEREF(__pyx_r);
17853 __Pyx_TraceReturn(__pyx_r, 0);
17854 __Pyx_RefNannyFinishContext();
17866 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17867 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17868 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17869 PyObject *__pyx_r = 0;
17870 __Pyx_RefNannyDeclarations
17871 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17872 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17875 __Pyx_RefNannyFinishContext();
17879 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17880 PyObject *__pyx_r = NULL;
17881 __Pyx_TraceDeclarations
17882 __Pyx_RefNannyDeclarations
17883 PyObject *__pyx_t_1 = NULL;
17884 int __pyx_lineno = 0;
17885 const char *__pyx_filename = NULL;
17886 int __pyx_clineno = 0;
17887 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17888 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17895 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17896 __Pyx_GOTREF(__pyx_t_1);
17897 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17898 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17899 __PYX_ERR(1, 4, __pyx_L1_error)
17910 __Pyx_XDECREF(__pyx_t_1);
17911 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17913 __Pyx_XGIVEREF(__pyx_r);
17914 __Pyx_TraceReturn(__pyx_r, 0);
17915 __Pyx_RefNannyFinishContext();
17927 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17928 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17929 Py_ssize_t __pyx_v_suboffset;
17930 PyObject *__pyx_v_length = NULL;
17931 PyObject *__pyx_r = NULL;
17932 __Pyx_TraceDeclarations
17933 __Pyx_RefNannyDeclarations
17935 PyObject *__pyx_t_2 = NULL;
17936 PyObject *__pyx_t_3 = NULL;
17937 __Pyx_TypeInfo *__pyx_t_4;
17938 Py_buffer __pyx_t_5;
17939 Py_ssize_t *__pyx_t_6;
17940 Py_ssize_t *__pyx_t_7;
17941 Py_ssize_t *__pyx_t_8;
17942 Py_ssize_t __pyx_t_9;
17943 int __pyx_lineno = 0;
17944 const char *__pyx_filename = NULL;
17945 int __pyx_clineno = 0;
17946 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17947 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
17956 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17966 __Pyx_XDECREF(__pyx_r);
17967 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17986 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17987 __Pyx_GOTREF(__pyx_t_2);
17988 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17989 __Pyx_GOTREF(__pyx_t_3);
17990 __Pyx_INCREF(Py_None);
17991 __Pyx_GIVEREF(Py_None);
17992 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17993 __Pyx_INCREF(__pyx_int_0);
17994 __Pyx_GIVEREF(__pyx_int_0);
17995 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17996 __Pyx_GIVEREF(__pyx_t_2);
17997 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17999 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18000 __Pyx_GOTREF(__pyx_t_2);
18001 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18002 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18012 __pyx_v_result->from_slice = __pyx_v_memviewslice;
18021 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18030 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
18031 __Pyx_GOTREF(__pyx_t_2);
18032 __Pyx_GIVEREF(__pyx_t_2);
18033 __Pyx_GOTREF(__pyx_v_result->from_object);
18034 __Pyx_DECREF(__pyx_v_result->from_object);
18035 __pyx_v_result->from_object = __pyx_t_2;
18045 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18046 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18055 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18056 __pyx_v_result->__pyx_base.view = __pyx_t_5;
18065 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
18074 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18083 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18092 Py_INCREF(Py_None);
18101 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18111 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18131 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18142 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18151 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18160 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18169 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18170 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18171 __pyx_t_6 = __pyx_t_8;
18172 __pyx_v_suboffset = (__pyx_t_6[0]);
18181 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18191 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18200 goto __pyx_L6_break;
18220 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18221 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18230 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18231 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18232 __pyx_t_6 = __pyx_t_8;
18233 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18234 __Pyx_GOTREF(__pyx_t_2);
18235 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18245 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18246 __Pyx_GOTREF(__pyx_t_2);
18247 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18248 __Pyx_GOTREF(__pyx_t_3);
18249 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18250 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18252 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18262 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18271 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18280 __Pyx_XDECREF(__pyx_r);
18281 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18282 __pyx_r = ((PyObject *)__pyx_v_result);
18295 __Pyx_XDECREF(__pyx_t_2);
18296 __Pyx_XDECREF(__pyx_t_3);
18297 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18300 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18301 __Pyx_XDECREF(__pyx_v_length);
18302 __Pyx_XGIVEREF(__pyx_r);
18303 __Pyx_TraceReturn(__pyx_r, 0);
18304 __Pyx_RefNannyFinishContext();
18316 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18317 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18318 __Pyx_memviewslice *__pyx_r;
18319 __Pyx_TraceDeclarations
18320 __Pyx_RefNannyDeclarations
18323 PyObject *__pyx_t_3 = NULL;
18324 int __pyx_lineno = 0;
18325 const char *__pyx_filename = NULL;
18326 int __pyx_clineno = 0;
18327 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
18328 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
18337 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18338 __pyx_t_2 = (__pyx_t_1 != 0);
18348 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
18349 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18350 __Pyx_INCREF(__pyx_t_3);
18351 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18361 __pyx_r = (&__pyx_v_obj->from_slice);
18381 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18390 __pyx_r = __pyx_v_mslice;
18404 __Pyx_XDECREF(__pyx_t_3);
18405 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18408 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18409 __Pyx_TraceReturn(Py_None, 0);
18410 __Pyx_RefNannyFinishContext();
18422 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18424 Py_ssize_t *__pyx_v_shape;
18425 Py_ssize_t *__pyx_v_strides;
18426 Py_ssize_t *__pyx_v_suboffsets;
18427 __Pyx_TraceDeclarations
18428 __Pyx_RefNannyDeclarations
18429 Py_ssize_t *__pyx_t_1;
18433 Py_ssize_t __pyx_t_5;
18434 int __pyx_lineno = 0;
18435 const char *__pyx_filename = NULL;
18436 int __pyx_clineno = 0;
18437 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18438 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
18447 __pyx_t_1 = __pyx_v_memview->view.shape;
18448 __pyx_v_shape = __pyx_t_1;
18457 __pyx_t_1 = __pyx_v_memview->view.strides;
18458 __pyx_v_strides = __pyx_t_1;
18467 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18468 __pyx_v_suboffsets = __pyx_t_1;
18477 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18486 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18495 __pyx_t_2 = __pyx_v_memview->view.ndim;
18496 __pyx_t_3 = __pyx_t_2;
18497 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18498 __pyx_v_dim = __pyx_t_4;
18507 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18516 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18525 if ((__pyx_v_suboffsets != 0)) {
18526 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18530 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18544 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18546 __Pyx_TraceReturn(Py_None, 0);
18547 __Pyx_RefNannyFinishContext();
18558 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18559 __Pyx_memviewslice __pyx_v_memviewslice;
18560 PyObject *__pyx_r = NULL;
18561 __Pyx_TraceDeclarations
18562 __Pyx_RefNannyDeclarations
18563 PyObject *__pyx_t_1 = NULL;
18564 int __pyx_lineno = 0;
18565 const char *__pyx_filename = NULL;
18566 int __pyx_clineno = 0;
18567 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18568 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
18577 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18586 __Pyx_XDECREF(__pyx_r);
18587 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18588 __Pyx_GOTREF(__pyx_t_1);
18589 __pyx_r = __pyx_t_1;
18603 __Pyx_XDECREF(__pyx_t_1);
18604 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18607 __Pyx_XGIVEREF(__pyx_r);
18608 __Pyx_TraceReturn(__pyx_r, 0);
18609 __Pyx_RefNannyFinishContext();
18621 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18622 PyObject *(*__pyx_v_to_object_func)(
char *);
18623 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18624 PyObject *__pyx_r = NULL;
18625 __Pyx_TraceDeclarations
18626 __Pyx_RefNannyDeclarations
18629 PyObject *(*__pyx_t_3)(
char *);
18630 int (*__pyx_t_4)(
char *, PyObject *);
18631 PyObject *__pyx_t_5 = NULL;
18632 int __pyx_lineno = 0;
18633 const char *__pyx_filename = NULL;
18634 int __pyx_clineno = 0;
18635 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18636 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
18645 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18646 __pyx_t_2 = (__pyx_t_1 != 0);
18656 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18657 __pyx_v_to_object_func = __pyx_t_3;
18666 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18667 __pyx_v_to_dtype_func = __pyx_t_4;
18687 __pyx_v_to_object_func = NULL;
18696 __pyx_v_to_dtype_func = NULL;
18707 __Pyx_XDECREF(__pyx_r);
18716 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18717 __Pyx_GOTREF(__pyx_t_5);
18718 __pyx_r = __pyx_t_5;
18732 __Pyx_XDECREF(__pyx_t_5);
18733 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18736 __Pyx_XGIVEREF(__pyx_r);
18737 __Pyx_TraceReturn(__pyx_r, 0);
18738 __Pyx_RefNannyFinishContext();
18750 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18751 Py_ssize_t __pyx_r;
18752 __Pyx_TraceDeclarations
18754 int __pyx_lineno = 0;
18755 const char *__pyx_filename = NULL;
18756 int __pyx_clineno = 0;
18757 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
18766 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18776 __pyx_r = (-__pyx_v_arg);
18796 __pyx_r = __pyx_v_arg;
18810 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18813 __Pyx_TraceReturn(Py_None, 1);
18825 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18827 Py_ssize_t __pyx_v_c_stride;
18828 Py_ssize_t __pyx_v_f_stride;
18830 __Pyx_TraceDeclarations
18835 int __pyx_lineno = 0;
18836 const char *__pyx_filename = NULL;
18837 int __pyx_clineno = 0;
18838 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
18847 __pyx_v_c_stride = 0;
18856 __pyx_v_f_stride = 0;
18865 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18866 __pyx_v_i = __pyx_t_1;
18875 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18885 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18894 goto __pyx_L4_break;
18914 __pyx_t_1 = __pyx_v_ndim;
18915 __pyx_t_3 = __pyx_t_1;
18916 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18917 __pyx_v_i = __pyx_t_4;
18926 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18936 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18945 goto __pyx_L7_break;
18965 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19009 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19012 __Pyx_TraceReturn(Py_None, 1);
19024 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19025 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19026 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19027 Py_ssize_t __pyx_v_dst_extent;
19028 Py_ssize_t __pyx_v_src_stride;
19029 Py_ssize_t __pyx_v_dst_stride;
19033 Py_ssize_t __pyx_t_4;
19034 Py_ssize_t __pyx_t_5;
19035 Py_ssize_t __pyx_t_6;
19044 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19053 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19062 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19071 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19080 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19090 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19093 __pyx_t_1 = __pyx_t_2;
19094 goto __pyx_L5_bool_binop_done;
19096 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19099 __pyx_t_1 = __pyx_t_2;
19100 goto __pyx_L5_bool_binop_done;
19110 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19112 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19114 __pyx_t_3 = (__pyx_t_2 != 0);
19115 __pyx_t_1 = __pyx_t_3;
19116 __pyx_L5_bool_binop_done:;
19134 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19154 __pyx_t_4 = __pyx_v_dst_extent;
19155 __pyx_t_5 = __pyx_t_4;
19156 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19157 __pyx_v_i = __pyx_t_6;
19166 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19175 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19184 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19207 __pyx_t_4 = __pyx_v_dst_extent;
19208 __pyx_t_5 = __pyx_t_4;
19209 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19210 __pyx_v_i = __pyx_t_6;
19219 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19228 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19237 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19261 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19262 __Pyx_TraceDeclarations
19263 int __pyx_lineno = 0;
19264 const char *__pyx_filename = NULL;
19265 int __pyx_clineno = 0;
19266 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
19275 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19288 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19290 __Pyx_TraceReturn(Py_None, 1);
19301 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
19302 Py_ssize_t __pyx_v_shape;
19303 Py_ssize_t __pyx_v_size;
19304 Py_ssize_t __pyx_r;
19305 __Pyx_TraceDeclarations
19306 Py_ssize_t __pyx_t_1;
19307 Py_ssize_t *__pyx_t_2;
19308 Py_ssize_t *__pyx_t_3;
19309 Py_ssize_t *__pyx_t_4;
19310 int __pyx_lineno = 0;
19311 const char *__pyx_filename = NULL;
19312 int __pyx_clineno = 0;
19313 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
19322 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19323 __pyx_v_size = __pyx_t_1;
19332 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19333 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19334 __pyx_t_2 = __pyx_t_4;
19335 __pyx_v_shape = (__pyx_t_2[0]);
19344 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19354 __pyx_r = __pyx_v_size;
19367 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19370 __Pyx_TraceReturn(Py_None, 1);
19382 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
19384 Py_ssize_t __pyx_r;
19385 __Pyx_TraceDeclarations
19390 int __pyx_lineno = 0;
19391 const char *__pyx_filename = NULL;
19392 int __pyx_clineno = 0;
19393 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
19402 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19412 __pyx_t_2 = __pyx_v_ndim;
19413 __pyx_t_3 = __pyx_t_2;
19414 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19415 __pyx_v_idx = __pyx_t_4;
19424 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19433 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19454 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19455 __pyx_v_idx = __pyx_t_2;
19464 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19473 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19485 __pyx_r = __pyx_v_stride;
19498 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19501 __Pyx_TraceReturn(Py_None, 1);
19513 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
19515 void *__pyx_v_result;
19516 size_t __pyx_v_itemsize;
19517 size_t __pyx_v_size;
19519 __Pyx_TraceDeclarations
19520 Py_ssize_t __pyx_t_1;
19523 struct __pyx_memoryview_obj *__pyx_t_4;
19526 int __pyx_lineno = 0;
19527 const char *__pyx_filename = NULL;
19528 int __pyx_clineno = 0;
19529 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
19538 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19539 __pyx_v_itemsize = __pyx_t_1;
19548 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19557 __pyx_v_result = malloc(__pyx_v_size);
19566 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19576 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19594 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19603 __pyx_t_4 = __pyx_v_src->memview;
19604 __pyx_v_tmpslice->memview = __pyx_t_4;
19613 __pyx_t_3 = __pyx_v_ndim;
19614 __pyx_t_5 = __pyx_t_3;
19615 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19616 __pyx_v_i = __pyx_t_6;
19625 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19634 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19644 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19653 __pyx_t_3 = __pyx_v_ndim;
19654 __pyx_t_5 = __pyx_t_3;
19655 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19656 __pyx_v_i = __pyx_t_6;
19665 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19675 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19694 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19704 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19724 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19735 __pyx_r = __pyx_v_result;
19750 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19752 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19754 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19759 __Pyx_TraceReturn(Py_None, 1);
19771 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19773 __Pyx_TraceDeclarations
19774 __Pyx_RefNannyDeclarations
19775 PyObject *__pyx_t_1 = NULL;
19776 PyObject *__pyx_t_2 = NULL;
19777 PyObject *__pyx_t_3 = NULL;
19778 PyObject *__pyx_t_4 = NULL;
19779 int __pyx_lineno = 0;
19780 const char *__pyx_filename = NULL;
19781 int __pyx_clineno = 0;
19783 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19785 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19786 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
19795 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19796 __Pyx_GOTREF(__pyx_t_1);
19797 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19798 __Pyx_GOTREF(__pyx_t_2);
19799 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19800 __Pyx_GOTREF(__pyx_t_3);
19801 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19802 __Pyx_GOTREF(__pyx_t_4);
19803 __Pyx_GIVEREF(__pyx_t_1);
19804 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19805 __Pyx_GIVEREF(__pyx_t_2);
19806 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19807 __Pyx_GIVEREF(__pyx_t_3);
19808 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19820 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19821 __Pyx_GOTREF(__pyx_t_3);
19822 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19823 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19824 __Pyx_GOTREF(__pyx_t_4);
19825 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19826 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19827 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19828 __PYX_ERR(1, 1253, __pyx_L1_error)
19840 __Pyx_XDECREF(__pyx_t_1);
19841 __Pyx_XDECREF(__pyx_t_2);
19842 __Pyx_XDECREF(__pyx_t_3);
19843 __Pyx_XDECREF(__pyx_t_4);
19844 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19846 __Pyx_TraceReturn(Py_None, 0);
19847 __Pyx_RefNannyFinishContext();
19849 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19862 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19864 __Pyx_TraceDeclarations
19865 __Pyx_RefNannyDeclarations
19866 PyObject *__pyx_t_1 = NULL;
19867 PyObject *__pyx_t_2 = NULL;
19868 PyObject *__pyx_t_3 = NULL;
19869 PyObject *__pyx_t_4 = NULL;
19870 int __pyx_lineno = 0;
19871 const char *__pyx_filename = NULL;
19872 int __pyx_clineno = 0;
19874 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19876 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19877 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
19878 __Pyx_INCREF(__pyx_v_error);
19887 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19888 __Pyx_GOTREF(__pyx_t_2);
19889 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19890 __Pyx_GOTREF(__pyx_t_3);
19891 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19892 __Pyx_GOTREF(__pyx_t_4);
19893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19894 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19895 __Pyx_INCREF(__pyx_v_error);
19896 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19897 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19898 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19899 if (likely(__pyx_t_2)) {
19900 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19901 __Pyx_INCREF(__pyx_t_2);
19902 __Pyx_INCREF(
function);
19903 __Pyx_DECREF_SET(__pyx_t_3,
function);
19906 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19907 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19908 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19909 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19910 __Pyx_GOTREF(__pyx_t_1);
19911 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19912 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19913 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19914 __PYX_ERR(1, 1258, __pyx_L1_error)
19926 __Pyx_XDECREF(__pyx_t_1);
19927 __Pyx_XDECREF(__pyx_t_2);
19928 __Pyx_XDECREF(__pyx_t_3);
19929 __Pyx_XDECREF(__pyx_t_4);
19930 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19932 __Pyx_XDECREF(__pyx_v_error);
19933 __Pyx_TraceReturn(Py_None, 0);
19934 __Pyx_RefNannyFinishContext();
19936 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19949 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19951 __Pyx_TraceDeclarations
19952 __Pyx_RefNannyDeclarations
19954 PyObject *__pyx_t_2 = NULL;
19955 PyObject *__pyx_t_3 = NULL;
19956 PyObject *__pyx_t_4 = NULL;
19957 PyObject *__pyx_t_5 = NULL;
19958 int __pyx_lineno = 0;
19959 const char *__pyx_filename = NULL;
19960 int __pyx_clineno = 0;
19962 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19964 __Pyx_RefNannySetupContext(
"_err", 0);
19965 __Pyx_TraceCall(
"_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19966 __Pyx_INCREF(__pyx_v_error);
19975 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19976 if (unlikely(__pyx_t_1)) {
19985 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19986 __Pyx_GOTREF(__pyx_t_3);
19987 __Pyx_INCREF(__pyx_v_error);
19988 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19989 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19990 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19991 if (likely(__pyx_t_5)) {
19992 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19993 __Pyx_INCREF(__pyx_t_5);
19994 __Pyx_INCREF(
function);
19995 __Pyx_DECREF_SET(__pyx_t_4,
function);
19998 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19999 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20000 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20001 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
20002 __Pyx_GOTREF(__pyx_t_2);
20003 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20004 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20005 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20006 __PYX_ERR(1, 1263, __pyx_L1_error)
20025 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20026 __PYX_ERR(1, 1265, __pyx_L1_error)
20039 __Pyx_XDECREF(__pyx_t_2);
20040 __Pyx_XDECREF(__pyx_t_3);
20041 __Pyx_XDECREF(__pyx_t_4);
20042 __Pyx_XDECREF(__pyx_t_5);
20043 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20045 __Pyx_XDECREF(__pyx_v_error);
20046 __Pyx_TraceReturn(Py_None, 0);
20047 __Pyx_RefNannyFinishContext();
20049 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20062 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
20063 void *__pyx_v_tmpdata;
20064 size_t __pyx_v_itemsize;
20066 char __pyx_v_order;
20067 int __pyx_v_broadcasting;
20068 int __pyx_v_direct_copy;
20069 __Pyx_memviewslice __pyx_v_tmp;
20072 __Pyx_TraceDeclarations
20073 Py_ssize_t __pyx_t_1;
20081 int __pyx_lineno = 0;
20082 const char *__pyx_filename = NULL;
20083 int __pyx_clineno = 0;
20084 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
20093 __pyx_v_tmpdata = NULL;
20102 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20103 __pyx_v_itemsize = __pyx_t_1;
20112 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20121 __pyx_v_broadcasting = 0;
20130 __pyx_v_direct_copy = 0;
20139 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20149 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20168 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20178 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20197 __pyx_t_3 = __pyx_v_dst_ndim;
20198 __pyx_t_4 = __pyx_v_src_ndim;
20199 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20200 __pyx_t_5 = __pyx_t_3;
20202 __pyx_t_5 = __pyx_t_4;
20204 __pyx_v_ndim = __pyx_t_5;
20213 __pyx_t_5 = __pyx_v_ndim;
20214 __pyx_t_3 = __pyx_t_5;
20215 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20216 __pyx_v_i = __pyx_t_4;
20225 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20235 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20245 __pyx_v_broadcasting = 1;
20254 (__pyx_v_src.strides[__pyx_v_i]) = 0;
20274 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20294 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20304 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
20323 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20333 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20343 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20361 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20362 __pyx_v_tmpdata = __pyx_t_7;
20371 __pyx_v_src = __pyx_v_tmp;
20389 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20399 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20409 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20428 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20438 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20457 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20467 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20476 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20485 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20494 free(__pyx_v_tmpdata);
20531 __pyx_t_2 = (__pyx_v_order ==
'F');
20533 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20535 __pyx_t_8 = (__pyx_t_2 != 0);
20545 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20554 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20572 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20581 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20590 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20599 free(__pyx_v_tmpdata);
20623 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20625 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20627 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20632 __Pyx_TraceReturn(Py_None, 1);
20644 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20646 int __pyx_v_offset;
20647 __Pyx_TraceDeclarations
20651 int __pyx_lineno = 0;
20652 const char *__pyx_filename = NULL;
20653 int __pyx_clineno = 0;
20654 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
20663 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20672 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20673 __pyx_v_i = __pyx_t_1;
20682 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20691 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20700 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20710 __pyx_t_1 = __pyx_v_offset;
20711 __pyx_t_2 = __pyx_t_1;
20712 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20713 __pyx_v_i = __pyx_t_3;
20722 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20731 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20740 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20754 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20756 __Pyx_TraceReturn(Py_None, 1);
20767 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20768 __Pyx_TraceDeclarations
20770 int __pyx_lineno = 0;
20771 const char *__pyx_filename = NULL;
20772 int __pyx_clineno = 0;
20773 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
20782 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20792 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20814 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20816 __Pyx_TraceReturn(Py_None, 1);
20827 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20828 __Pyx_TraceDeclarations
20829 __Pyx_RefNannyDeclarations
20830 int __pyx_lineno = 0;
20831 const char *__pyx_filename = NULL;
20832 int __pyx_clineno = 0;
20834 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20836 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20837 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20846 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20859 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20861 __Pyx_TraceReturn(Py_None, 0);
20862 __Pyx_RefNannyFinishContext();
20864 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20876 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20877 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20878 __Pyx_TraceDeclarations
20879 __Pyx_RefNannyDeclarations
20880 Py_ssize_t __pyx_t_1;
20881 Py_ssize_t __pyx_t_2;
20882 Py_ssize_t __pyx_t_3;
20884 int __pyx_lineno = 0;
20885 const char *__pyx_filename = NULL;
20886 int __pyx_clineno = 0;
20887 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20888 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20897 __pyx_t_1 = (__pyx_v_shape[0]);
20898 __pyx_t_2 = __pyx_t_1;
20899 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20900 __pyx_v_i = __pyx_t_3;
20909 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20919 __pyx_t_4 = (__pyx_v_inc != 0);
20929 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20949 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20979 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20990 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21004 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21006 __Pyx_TraceReturn(Py_None, 0);
21007 __Pyx_RefNannyFinishContext();
21018 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
21019 __Pyx_TraceDeclarations
21020 int __pyx_lineno = 0;
21021 const char *__pyx_filename = NULL;
21022 int __pyx_clineno = 0;
21023 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
21032 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21041 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21050 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21063 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21065 __Pyx_TraceReturn(Py_None, 1);
21076 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
21077 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21078 Py_ssize_t __pyx_v_stride;
21079 Py_ssize_t __pyx_v_extent;
21080 __Pyx_TraceDeclarations
21082 Py_ssize_t __pyx_t_2;
21083 Py_ssize_t __pyx_t_3;
21084 Py_ssize_t __pyx_t_4;
21085 int __pyx_lineno = 0;
21086 const char *__pyx_filename = NULL;
21087 int __pyx_clineno = 0;
21088 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
21097 __pyx_v_stride = (__pyx_v_strides[0]);
21106 __pyx_v_extent = (__pyx_v_shape[0]);
21115 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21125 __pyx_t_2 = __pyx_v_extent;
21126 __pyx_t_3 = __pyx_t_2;
21127 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21128 __pyx_v_i = __pyx_t_4;
21137 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21146 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21167 __pyx_t_2 = __pyx_v_extent;
21168 __pyx_t_3 = __pyx_t_2;
21169 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21170 __pyx_v_i = __pyx_t_4;
21179 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21188 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21204 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21206 __Pyx_TraceReturn(Py_None, 1);
21216 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
21217 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21218 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21219 PyObject *__pyx_v___pyx_type = 0;
21220 long __pyx_v___pyx_checksum;
21221 PyObject *__pyx_v___pyx_state = 0;
21222 int __pyx_lineno = 0;
21223 const char *__pyx_filename = NULL;
21224 int __pyx_clineno = 0;
21225 PyObject *__pyx_r = 0;
21226 __Pyx_RefNannyDeclarations
21227 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
21229 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21230 PyObject* values[3] = {0,0,0};
21231 if (unlikely(__pyx_kwds)) {
21232 Py_ssize_t kw_args;
21233 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21234 switch (pos_args) {
21235 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21236 CYTHON_FALLTHROUGH;
21237 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21238 CYTHON_FALLTHROUGH;
21239 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21240 CYTHON_FALLTHROUGH;
21242 default:
goto __pyx_L5_argtuple_error;
21244 kw_args = PyDict_Size(__pyx_kwds);
21245 switch (pos_args) {
21247 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21248 else goto __pyx_L5_argtuple_error;
21249 CYTHON_FALLTHROUGH;
21251 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21253 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21255 CYTHON_FALLTHROUGH;
21257 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21259 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21262 if (unlikely(kw_args > 0)) {
21263 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21265 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21266 goto __pyx_L5_argtuple_error;
21268 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21269 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21270 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21272 __pyx_v___pyx_type = values[0];
21273 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21274 __pyx_v___pyx_state = values[2];
21276 goto __pyx_L4_argument_unpacking_done;
21277 __pyx_L5_argtuple_error:;
21278 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21280 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21281 __Pyx_RefNannyFinishContext();
21283 __pyx_L4_argument_unpacking_done:;
21284 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21287 __Pyx_RefNannyFinishContext();
21291 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21292 PyObject *__pyx_v___pyx_PickleError = 0;
21293 PyObject *__pyx_v___pyx_result = 0;
21294 PyObject *__pyx_r = NULL;
21295 __Pyx_TraceDeclarations
21296 __Pyx_RefNannyDeclarations
21298 PyObject *__pyx_t_2 = NULL;
21299 PyObject *__pyx_t_3 = NULL;
21300 PyObject *__pyx_t_4 = NULL;
21301 PyObject *__pyx_t_5 = NULL;
21303 int __pyx_lineno = 0;
21304 const char *__pyx_filename = NULL;
21305 int __pyx_clineno = 0;
21306 __Pyx_TraceFrameInit(__pyx_codeobj__37)
21307 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
21308 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21317 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21327 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21328 __Pyx_GOTREF(__pyx_t_2);
21329 __Pyx_INCREF(__pyx_n_s_PickleError);
21330 __Pyx_GIVEREF(__pyx_n_s_PickleError);
21331 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21332 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21333 __Pyx_GOTREF(__pyx_t_3);
21334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21335 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21336 __Pyx_GOTREF(__pyx_t_2);
21337 __Pyx_INCREF(__pyx_t_2);
21338 __pyx_v___pyx_PickleError = __pyx_t_2;
21339 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21340 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21349 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21350 __Pyx_GOTREF(__pyx_t_2);
21351 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21352 __Pyx_GOTREF(__pyx_t_4);
21353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21354 __Pyx_INCREF(__pyx_v___pyx_PickleError);
21355 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21356 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21357 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21358 if (likely(__pyx_t_5)) {
21359 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21360 __Pyx_INCREF(__pyx_t_5);
21361 __Pyx_INCREF(
function);
21362 __Pyx_DECREF_SET(__pyx_t_2,
function);
21365 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21366 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21367 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21368 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21369 __Pyx_GOTREF(__pyx_t_3);
21370 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21371 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21372 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21373 __PYX_ERR(1, 6, __pyx_L1_error)
21391 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21392 __Pyx_GOTREF(__pyx_t_2);
21394 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21395 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21396 if (likely(__pyx_t_4)) {
21397 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21398 __Pyx_INCREF(__pyx_t_4);
21399 __Pyx_INCREF(
function);
21400 __Pyx_DECREF_SET(__pyx_t_2,
function);
21403 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21404 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21405 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21406 __Pyx_GOTREF(__pyx_t_3);
21407 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21408 __pyx_v___pyx_result = __pyx_t_3;
21418 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21419 __pyx_t_6 = (__pyx_t_1 != 0);
21429 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21430 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21431 __Pyx_GOTREF(__pyx_t_3);
21432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21450 __Pyx_XDECREF(__pyx_r);
21451 __Pyx_INCREF(__pyx_v___pyx_result);
21452 __pyx_r = __pyx_v___pyx_result;
21463 __Pyx_XDECREF(__pyx_t_2);
21464 __Pyx_XDECREF(__pyx_t_3);
21465 __Pyx_XDECREF(__pyx_t_4);
21466 __Pyx_XDECREF(__pyx_t_5);
21467 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21470 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21471 __Pyx_XDECREF(__pyx_v___pyx_result);
21472 __Pyx_XGIVEREF(__pyx_r);
21473 __Pyx_TraceReturn(__pyx_r, 0);
21474 __Pyx_RefNannyFinishContext();
21486 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21487 PyObject *__pyx_r = NULL;
21488 __Pyx_TraceDeclarations
21489 __Pyx_RefNannyDeclarations
21490 PyObject *__pyx_t_1 = NULL;
21492 Py_ssize_t __pyx_t_3;
21495 PyObject *__pyx_t_6 = NULL;
21496 PyObject *__pyx_t_7 = NULL;
21497 PyObject *__pyx_t_8 = NULL;
21498 int __pyx_lineno = 0;
21499 const char *__pyx_filename = NULL;
21500 int __pyx_clineno = 0;
21501 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21502 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21511 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21512 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21513 __PYX_ERR(1, 12, __pyx_L1_error)
21515 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21516 __Pyx_GOTREF(__pyx_t_1);
21517 __Pyx_GIVEREF(__pyx_t_1);
21518 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21519 __Pyx_DECREF(__pyx_v___pyx_result->name);
21520 __pyx_v___pyx_result->name = __pyx_t_1;
21529 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21530 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21531 __PYX_ERR(1, 13, __pyx_L1_error)
21533 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21534 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21537 __pyx_t_2 = __pyx_t_4;
21538 goto __pyx_L4_bool_binop_done;
21540 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21541 __pyx_t_5 = (__pyx_t_4 != 0);
21542 __pyx_t_2 = __pyx_t_5;
21543 __pyx_L4_bool_binop_done:;
21551 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21552 __Pyx_GOTREF(__pyx_t_6);
21553 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21554 __Pyx_GOTREF(__pyx_t_7);
21555 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21556 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21557 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21558 __PYX_ERR(1, 14, __pyx_L1_error)
21560 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21561 __Pyx_GOTREF(__pyx_t_6);
21563 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21564 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21565 if (likely(__pyx_t_8)) {
21566 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21567 __Pyx_INCREF(__pyx_t_8);
21568 __Pyx_INCREF(
function);
21569 __Pyx_DECREF_SET(__pyx_t_7,
function);
21572 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21573 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21574 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21575 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21576 __Pyx_GOTREF(__pyx_t_1);
21577 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21597 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21600 __Pyx_XDECREF(__pyx_t_1);
21601 __Pyx_XDECREF(__pyx_t_6);
21602 __Pyx_XDECREF(__pyx_t_7);
21603 __Pyx_XDECREF(__pyx_t_8);
21604 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21607 __Pyx_XGIVEREF(__pyx_r);
21608 __Pyx_TraceReturn(__pyx_r, 0);
21609 __Pyx_RefNannyFinishContext();
21613 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21614 struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21616 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21617 o = (*t->tp_alloc)(t, 0);
21619 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21621 if (unlikely(!o))
return 0;
21622 p = ((
struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21623 p->Shape = Py_None; Py_INCREF(Py_None);
21624 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21625 p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21626 p->ct = Py_None; Py_INCREF(Py_None);
21627 p->_b_or.data = NULL;
21628 p->_b_or.memview = NULL;
21632 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21633 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21634 #if CYTHON_USE_TP_FINALIZE
21635 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21636 if (PyObject_CallFinalizerFromDealloc(o))
return;
21639 PyObject_GC_UnTrack(o);
21640 Py_CLEAR(p->Shape);
21642 Py_CLEAR(p->BC_type);
21644 __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21645 (*Py_TYPE(o)->tp_free)(o);
21648 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc
v,
void *a) {
21650 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21652 e = (*v)(p->Shape, a);
if (e)
return e;
21655 e = (*v)(p->ct, a);
if (e)
return e;
21660 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21662 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21663 tmp = ((PyObject*)p->Shape);
21664 p->Shape = Py_None; Py_INCREF(Py_None);
21666 tmp = ((PyObject*)p->ct);
21667 p->ct = Py_None; Py_INCREF(Py_None);
21672 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED
void *x) {
21673 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21676 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21678 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o,
v);
21681 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
21686 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED
void *x) {
21687 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21690 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21692 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o,
v);
21695 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21699 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED
void *x) {
21700 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21703 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21705 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o,
v);
21708 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21712 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED
void *x) {
21713 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21716 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21718 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o,
v);
21721 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21725 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED
void *x) {
21726 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21729 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21731 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o,
v);
21734 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21738 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21739 {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21740 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
21741 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
21745 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21746 {(
char *)
"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (
char *)
"nd: 'int'", 0},
21747 {(
char *)
"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (
char *)
"Shape: object", 0},
21748 {(
char *)
"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (
char *)
"name: str", 0},
21749 {(
char *)
"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (
char *)
"BC_type: str", 0},
21750 {(
char *)
"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (
char *)
"ct: object", 0},
21754 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21755 PyVarObject_HEAD_INIT(0, 0)
21756 "BoundaryConditions.BC_Base",
21757 sizeof(
struct __pyx_obj_18BoundaryConditions_BC_Base),
21759 __pyx_tp_dealloc_18BoundaryConditions_BC_Base,
21760 #if PY_VERSION_HEX < 0x030800b4
21763 #if PY_VERSION_HEX >= 0x030800b4
21768 #if PY_MAJOR_VERSION < 3
21771 #if PY_MAJOR_VERSION >= 3
21784 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21785 "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ",
21786 __pyx_tp_traverse_18BoundaryConditions_BC_Base,
21787 __pyx_tp_clear_18BoundaryConditions_BC_Base,
21792 __pyx_methods_18BoundaryConditions_BC_Base,
21794 __pyx_getsets_18BoundaryConditions_BC_Base,
21800 __pyx_pw_18BoundaryConditions_7BC_Base_1__init__,
21802 __pyx_tp_new_18BoundaryConditions_BC_Base,
21812 #if PY_VERSION_HEX >= 0x030400a1
21815 #if PY_VERSION_HEX >= 0x030800b1
21818 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21822 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21824 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21825 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21827 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21828 o = (*t->tp_alloc)(t, 0);
21830 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21832 if (unlikely(!o))
return 0;
21833 p = ((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21834 p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21835 p->uOfXT = Py_None; Py_INCREF(Py_None);
21839 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21840 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21841 #if CYTHON_USE_TP_FINALIZE
21842 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21843 if (PyObject_CallFinalizerFromDealloc(o))
return;
21846 PyObject_GC_UnTrack(o);
21847 Py_CLEAR(p->uOfXT);
21848 (*Py_TYPE(o)->tp_free)(o);
21851 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc
v,
void *a) {
21853 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21855 e = (*v)(p->uOfXT, a);
if (e)
return e;
21860 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21862 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21863 tmp = ((PyObject*)p->uOfXT);
21864 p->uOfXT = Py_None; Py_INCREF(Py_None);
21869 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED
void *x) {
21870 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21873 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21875 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o,
v);
21878 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21882 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21883 {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
21884 {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21885 {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21886 {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21887 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
21888 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
21892 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21893 {(
char *)
"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (
char *)
"uOfXT: object", 0},
21897 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21898 PyVarObject_HEAD_INIT(0, 0)
21899 "BoundaryConditions.BoundaryCondition",
21900 sizeof(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition),
21902 __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition,
21903 #if PY_VERSION_HEX < 0x030800b4
21906 #if PY_VERSION_HEX >= 0x030800b4
21911 #if PY_MAJOR_VERSION < 3
21914 #if PY_MAJOR_VERSION >= 3
21927 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21928 "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ",
21929 __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition,
21930 __pyx_tp_clear_18BoundaryConditions_BoundaryCondition,
21935 __pyx_methods_18BoundaryConditions_BoundaryCondition,
21937 __pyx_getsets_18BoundaryConditions_BoundaryCondition,
21943 __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__,
21945 __pyx_tp_new_18BoundaryConditions_BoundaryCondition,
21955 #if PY_VERSION_HEX >= 0x030400a1
21958 #if PY_VERSION_HEX >= 0x030800b1
21961 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21966 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21967 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21969 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21971 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21972 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21973 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21974 (void) PyObject_INIT(o, t);
21975 PyObject_GC_Track(o);
21977 o = (*t->tp_alloc)(t, 0);
21978 if (unlikely(!o))
return 0;
21983 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21984 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21985 PyObject_GC_UnTrack(o);
21986 Py_CLEAR(p->__pyx_v_value);
21987 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21988 __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21990 (*Py_TYPE(o)->tp_free)(o);
21994 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc
v,
void *a) {
21996 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21997 if (p->__pyx_v_value) {
21998 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
22003 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
22005 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22006 tmp = ((PyObject*)p->__pyx_v_value);
22007 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22012 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
22013 PyVarObject_HEAD_INIT(0, 0)
22014 "BoundaryConditions.__pyx_scope_struct__setConstantBC",
22015 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC),
22017 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22018 #if PY_VERSION_HEX < 0x030800b4
22021 #if PY_VERSION_HEX >= 0x030800b4
22026 #if PY_MAJOR_VERSION < 3
22029 #if PY_MAJOR_VERSION >= 3
22042 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
22044 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22045 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22060 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22070 #if PY_VERSION_HEX >= 0x030400a1
22073 #if PY_VERSION_HEX >= 0x030800b1
22076 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22081 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
22082 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
22084 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22086 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22087 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
22088 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
22089 (void) PyObject_INIT(o, t);
22090 PyObject_GC_Track(o);
22092 o = (*t->tp_alloc)(t, 0);
22093 if (unlikely(!o))
return 0;
22098 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22099 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22100 PyObject_GC_UnTrack(o);
22101 Py_CLEAR(p->__pyx_v_a);
22102 Py_CLEAR(p->__pyx_v_a0);
22103 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22104 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
22106 (*Py_TYPE(o)->tp_free)(o);
22110 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc
v,
void *a) {
22112 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22113 if (p->__pyx_v_a) {
22114 e = (*v)(p->__pyx_v_a, a);
if (e)
return e;
22116 if (p->__pyx_v_a0) {
22117 e = (*v)(p->__pyx_v_a0, a);
if (e)
return e;
22122 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22124 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22125 tmp = ((PyObject*)p->__pyx_v_a);
22126 p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
22128 tmp = ((PyObject*)p->__pyx_v_a0);
22129 p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
22134 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
22135 PyVarObject_HEAD_INIT(0, 0)
22136 "BoundaryConditions.__pyx_scope_struct_1_setLinearBC",
22137 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC),
22139 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22140 #if PY_VERSION_HEX < 0x030800b4
22143 #if PY_VERSION_HEX >= 0x030800b4
22148 #if PY_MAJOR_VERSION < 3
22151 #if PY_MAJOR_VERSION >= 3
22164 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
22166 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22167 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22182 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22192 #if PY_VERSION_HEX >= 0x030400a1
22195 #if PY_VERSION_HEX >= 0x030800b1
22198 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22203 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
22204 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
22206 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22208 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22209 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
22210 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
22211 (void) PyObject_INIT(o, t);
22212 PyObject_GC_Track(o);
22214 o = (*t->tp_alloc)(t, 0);
22215 if (unlikely(!o))
return 0;
22220 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22221 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22222 PyObject_GC_UnTrack(o);
22223 Py_CLEAR(p->__pyx_v_t1);
22224 Py_CLEAR(p->__pyx_v_value);
22225 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22226 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
22228 (*Py_TYPE(o)->tp_free)(o);
22232 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc
v,
void *a) {
22234 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22235 if (p->__pyx_v_t1) {
22236 e = (*v)(p->__pyx_v_t1, a);
if (e)
return e;
22238 if (p->__pyx_v_value) {
22239 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
22244 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22246 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22247 tmp = ((PyObject*)p->__pyx_v_t1);
22248 p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
22250 tmp = ((PyObject*)p->__pyx_v_value);
22251 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22256 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
22257 PyVarObject_HEAD_INIT(0, 0)
22258 "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp",
22259 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp),
22261 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22262 #if PY_VERSION_HEX < 0x030800b4
22265 #if PY_VERSION_HEX >= 0x030800b4
22270 #if PY_MAJOR_VERSION < 3
22273 #if PY_MAJOR_VERSION >= 3
22286 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
22288 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22289 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22304 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22314 #if PY_VERSION_HEX >= 0x030400a1
22317 #if PY_VERSION_HEX >= 0x030800b1
22320 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22324 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22326 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22327 struct __pyx_array_obj *p;
22329 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22330 o = (*t->tp_alloc)(t, 0);
22332 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22334 if (unlikely(!o))
return 0;
22335 p = ((
struct __pyx_array_obj *)o);
22336 p->__pyx_vtab = __pyx_vtabptr_array;
22337 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22338 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22339 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
22342 Py_DECREF(o); o = 0;
22346 static void __pyx_tp_dealloc_array(PyObject *o) {
22347 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
22348 #if CYTHON_USE_TP_FINALIZE
22349 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22350 if (PyObject_CallFinalizerFromDealloc(o))
return;
22354 PyObject *etype, *eval, *etb;
22355 PyErr_Fetch(&etype, &eval, &etb);
22356 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22357 __pyx_array___dealloc__(o);
22358 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22359 PyErr_Restore(etype, eval, etb);
22362 Py_CLEAR(p->_format);
22363 (*Py_TYPE(o)->tp_free)(o);
22365 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22367 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22368 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22373 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
22375 return __pyx_array___setitem__(o, i,
v);
22378 PyErr_Format(PyExc_NotImplementedError,
22379 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22384 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
22385 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
22386 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22388 v = __pyx_array___getattr__(o,
n);
22393 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
22394 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22397 static PyMethodDef __pyx_methods_array[] = {
22398 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22399 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22400 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22404 static struct PyGetSetDef __pyx_getsets_array[] = {
22405 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
22409 static PySequenceMethods __pyx_tp_as_sequence_array = {
22410 __pyx_array___len__,
22413 __pyx_sq_item_array,
22422 static PyMappingMethods __pyx_tp_as_mapping_array = {
22423 __pyx_array___len__,
22424 __pyx_array___getitem__,
22425 __pyx_mp_ass_subscript_array,
22428 static PyBufferProcs __pyx_tp_as_buffer_array = {
22429 #if PY_MAJOR_VERSION < 3
22432 #if PY_MAJOR_VERSION < 3
22435 #if PY_MAJOR_VERSION < 3
22438 #if PY_MAJOR_VERSION < 3
22441 __pyx_array_getbuffer,
22445 static PyTypeObject __pyx_type___pyx_array = {
22446 PyVarObject_HEAD_INIT(0, 0)
22447 "BoundaryConditions.array",
22448 sizeof(
struct __pyx_array_obj),
22450 __pyx_tp_dealloc_array,
22451 #if PY_VERSION_HEX < 0x030800b4
22454 #if PY_VERSION_HEX >= 0x030800b4
22459 #if PY_MAJOR_VERSION < 3
22462 #if PY_MAJOR_VERSION >= 3
22467 &__pyx_tp_as_sequence_array,
22468 &__pyx_tp_as_mapping_array,
22472 __pyx_tp_getattro_array,
22474 &__pyx_tp_as_buffer_array,
22475 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22483 __pyx_methods_array,
22485 __pyx_getsets_array,
22493 __pyx_tp_new_array,
22503 #if PY_VERSION_HEX >= 0x030400a1
22506 #if PY_VERSION_HEX >= 0x030800b1
22509 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22514 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22515 struct __pyx_MemviewEnum_obj *p;
22517 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22518 o = (*t->tp_alloc)(t, 0);
22520 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22522 if (unlikely(!o))
return 0;
22523 p = ((
struct __pyx_MemviewEnum_obj *)o);
22524 p->name = Py_None; Py_INCREF(Py_None);
22528 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22529 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22530 #if CYTHON_USE_TP_FINALIZE
22531 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22532 if (PyObject_CallFinalizerFromDealloc(o))
return;
22535 PyObject_GC_UnTrack(o);
22537 (*Py_TYPE(o)->tp_free)(o);
22540 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22542 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22544 e = (*v)(p->name, a);
if (e)
return e;
22549 static int __pyx_tp_clear_Enum(PyObject *o) {
22551 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22552 tmp = ((PyObject*)p->name);
22553 p->name = Py_None; Py_INCREF(Py_None);
22558 static PyMethodDef __pyx_methods_Enum[] = {
22559 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22560 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22564 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22565 PyVarObject_HEAD_INIT(0, 0)
22566 "BoundaryConditions.Enum",
22567 sizeof(
struct __pyx_MemviewEnum_obj),
22569 __pyx_tp_dealloc_Enum,
22570 #if PY_VERSION_HEX < 0x030800b4
22573 #if PY_VERSION_HEX >= 0x030800b4
22578 #if PY_MAJOR_VERSION < 3
22581 #if PY_MAJOR_VERSION >= 3
22584 __pyx_MemviewEnum___repr__,
22594 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22596 __pyx_tp_traverse_Enum,
22597 __pyx_tp_clear_Enum,
22602 __pyx_methods_Enum,
22610 __pyx_MemviewEnum___init__,
22622 #if PY_VERSION_HEX >= 0x030400a1
22625 #if PY_VERSION_HEX >= 0x030800b1
22628 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22632 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22634 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22635 struct __pyx_memoryview_obj *p;
22637 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22638 o = (*t->tp_alloc)(t, 0);
22640 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22642 if (unlikely(!o))
return 0;
22643 p = ((
struct __pyx_memoryview_obj *)o);
22644 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22645 p->obj = Py_None; Py_INCREF(Py_None);
22646 p->_size = Py_None; Py_INCREF(Py_None);
22647 p->_array_interface = Py_None; Py_INCREF(Py_None);
22648 p->view.obj = NULL;
22649 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22652 Py_DECREF(o); o = 0;
22656 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22657 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22658 #if CYTHON_USE_TP_FINALIZE
22659 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22660 if (PyObject_CallFinalizerFromDealloc(o))
return;
22663 PyObject_GC_UnTrack(o);
22665 PyObject *etype, *eval, *etb;
22666 PyErr_Fetch(&etype, &eval, &etb);
22667 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22668 __pyx_memoryview___dealloc__(o);
22669 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22670 PyErr_Restore(etype, eval, etb);
22673 Py_CLEAR(p->_size);
22674 Py_CLEAR(p->_array_interface);
22675 (*Py_TYPE(o)->tp_free)(o);
22678 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22680 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22682 e = (*v)(p->obj, a);
if (e)
return e;
22685 e = (*v)(p->_size, a);
if (e)
return e;
22687 if (p->_array_interface) {
22688 e = (*v)(p->_array_interface, a);
if (e)
return e;
22691 e = (*v)(p->view.obj, a);
if (e)
return e;
22696 static int __pyx_tp_clear_memoryview(PyObject *o) {
22698 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22699 tmp = ((PyObject*)p->obj);
22700 p->obj = Py_None; Py_INCREF(Py_None);
22702 tmp = ((PyObject*)p->_size);
22703 p->_size = Py_None; Py_INCREF(Py_None);
22705 tmp = ((PyObject*)p->_array_interface);
22706 p->_array_interface = Py_None; Py_INCREF(Py_None);
22708 Py_CLEAR(p->view.obj);
22711 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22713 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22714 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22719 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22721 return __pyx_memoryview___setitem__(o, i,
v);
22724 PyErr_Format(PyExc_NotImplementedError,
22725 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22730 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22731 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22734 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22735 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22738 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22739 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22742 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22743 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22746 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22747 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22750 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22751 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22754 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22755 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22758 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22759 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22762 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22763 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22766 static PyMethodDef __pyx_methods_memoryview[] = {
22767 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22768 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22769 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22770 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22771 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22772 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22776 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22777 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22778 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22779 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22780 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22781 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22782 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22783 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22784 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22785 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22789 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22790 __pyx_memoryview___len__,
22793 __pyx_sq_item_memoryview,
22802 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22803 __pyx_memoryview___len__,
22804 __pyx_memoryview___getitem__,
22805 __pyx_mp_ass_subscript_memoryview,
22808 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22809 #if PY_MAJOR_VERSION < 3
22812 #if PY_MAJOR_VERSION < 3
22815 #if PY_MAJOR_VERSION < 3
22818 #if PY_MAJOR_VERSION < 3
22821 __pyx_memoryview_getbuffer,
22825 static PyTypeObject __pyx_type___pyx_memoryview = {
22826 PyVarObject_HEAD_INIT(0, 0)
22827 "BoundaryConditions.memoryview",
22828 sizeof(
struct __pyx_memoryview_obj),
22830 __pyx_tp_dealloc_memoryview,
22831 #if PY_VERSION_HEX < 0x030800b4
22834 #if PY_VERSION_HEX >= 0x030800b4
22839 #if PY_MAJOR_VERSION < 3
22842 #if PY_MAJOR_VERSION >= 3
22845 __pyx_memoryview___repr__,
22847 &__pyx_tp_as_sequence_memoryview,
22848 &__pyx_tp_as_mapping_memoryview,
22851 __pyx_memoryview___str__,
22854 &__pyx_tp_as_buffer_memoryview,
22855 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22857 __pyx_tp_traverse_memoryview,
22858 __pyx_tp_clear_memoryview,
22863 __pyx_methods_memoryview,
22865 __pyx_getsets_memoryview,
22873 __pyx_tp_new_memoryview,
22883 #if PY_VERSION_HEX >= 0x030400a1
22886 #if PY_VERSION_HEX >= 0x030800b1
22889 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22893 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22895 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22896 struct __pyx_memoryviewslice_obj *p;
22897 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22898 if (unlikely(!o))
return 0;
22899 p = ((
struct __pyx_memoryviewslice_obj *)o);
22900 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22901 p->from_object = Py_None; Py_INCREF(Py_None);
22902 p->from_slice.memview = NULL;
22906 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22907 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22908 #if CYTHON_USE_TP_FINALIZE
22909 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22910 if (PyObject_CallFinalizerFromDealloc(o))
return;
22913 PyObject_GC_UnTrack(o);
22915 PyObject *etype, *eval, *etb;
22916 PyErr_Fetch(&etype, &eval, &etb);
22917 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22918 __pyx_memoryviewslice___dealloc__(o);
22919 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22920 PyErr_Restore(etype, eval, etb);
22922 Py_CLEAR(p->from_object);
22923 PyObject_GC_Track(o);
22924 __pyx_tp_dealloc_memoryview(o);
22927 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22929 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22930 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22931 if (p->from_object) {
22932 e = (*v)(p->from_object, a);
if (e)
return e;
22937 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22939 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22940 __pyx_tp_clear_memoryview(o);
22941 tmp = ((PyObject*)p->from_object);
22942 p->from_object = Py_None; Py_INCREF(Py_None);
22944 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22948 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22949 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22952 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22953 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22954 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22958 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22959 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22963 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22964 PyVarObject_HEAD_INIT(0, 0)
22965 "BoundaryConditions._memoryviewslice",
22966 sizeof(
struct __pyx_memoryviewslice_obj),
22968 __pyx_tp_dealloc__memoryviewslice,
22969 #if PY_VERSION_HEX < 0x030800b4
22972 #if PY_VERSION_HEX >= 0x030800b4
22977 #if PY_MAJOR_VERSION < 3
22980 #if PY_MAJOR_VERSION >= 3
22983 #if CYTHON_COMPILING_IN_PYPY
22984 __pyx_memoryview___repr__,
22993 #if CYTHON_COMPILING_IN_PYPY
22994 __pyx_memoryview___str__,
23001 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23002 "Internal class for passing memoryview slices to Python",
23003 __pyx_tp_traverse__memoryviewslice,
23004 __pyx_tp_clear__memoryviewslice,
23009 __pyx_methods__memoryviewslice,
23011 __pyx_getsets__memoryviewslice,
23019 __pyx_tp_new__memoryviewslice,
23029 #if PY_VERSION_HEX >= 0x030400a1
23032 #if PY_VERSION_HEX >= 0x030800b1
23035 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
23040 static PyMethodDef __pyx_methods[] = {
23044 #if PY_MAJOR_VERSION >= 3
23045 #if CYTHON_PEP489_MULTI_PHASE_INIT
23046 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
23047 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module);
23048 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23049 {Py_mod_create, (
void*)__pyx_pymod_create},
23050 {Py_mod_exec, (
void*)__pyx_pymod_exec_BoundaryConditions},
23055 static struct PyModuleDef __pyx_moduledef = {
23056 PyModuleDef_HEAD_INIT,
23057 "BoundaryConditions",
23059 #if CYTHON_PEP489_MULTI_PHASE_INIT
23065 #if CYTHON_PEP489_MULTI_PHASE_INIT
23066 __pyx_moduledef_slots,
23075 #ifndef CYTHON_SMALL_CODE
23076 #if defined(__clang__)
23077 #define CYTHON_SMALL_CODE
23078 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
23079 #define CYTHON_SMALL_CODE __attribute__((cold))
23081 #define CYTHON_SMALL_CODE
23085 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23086 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23087 {&__pyx_n_s_BC_Base, __pyx_k_BC_Base,
sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
23088 {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython,
sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
23089 {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython,
sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
23090 {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext,
sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
23091 {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition,
sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
23092 {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho,
sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
23093 {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt,
sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
23094 {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython,
sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
23095 {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC,
sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
23096 {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC,
sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
23097 {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC,
sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
23098 {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp,
sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
23099 {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions,
sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
23100 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23101 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23102 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23103 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23104 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23105 {&__pyx_n_s_Context, __pyx_k_Context,
sizeof(__pyx_k_Context), 0, 0, 1, 1},
23106 {&__pyx_n_s_Domain, __pyx_k_Domain,
sizeof(__pyx_k_Domain), 0, 0, 1, 1},
23107 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23108 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23109 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23110 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23111 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23112 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
23113 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23114 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23115 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23116 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23117 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23118 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23119 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23120 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23121 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23122 {&__pyx_n_s_None, __pyx_k_None,
sizeof(__pyx_k_None), 0, 0, 1, 1},
23123 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
23124 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23125 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23126 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23127 {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC,
sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
23128 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23129 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23130 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23131 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23132 {&__pyx_n_s_a, __pyx_k_a,
sizeof(__pyx_k_a), 0, 0, 1, 1},
23133 {&__pyx_n_s_a0, __pyx_k_a0,
sizeof(__pyx_k_a0), 0, 0, 1, 1},
23134 {&__pyx_n_s_all, __pyx_k_all,
sizeof(__pyx_k_all), 0, 0, 1, 1},
23135 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23136 {&__pyx_n_s_b_i, __pyx_k_b_i,
sizeof(__pyx_k_b_i), 0, 0, 1, 1},
23137 {&__pyx_n_s_b_or, __pyx_k_b_or,
sizeof(__pyx_k_b_or), 0, 0, 1, 1},
23138 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
23139 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
23140 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
23141 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
23142 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23143 {&__pyx_n_s_context, __pyx_k_context,
sizeof(__pyx_k_context), 0, 0, 1, 1},
23144 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23145 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23146 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
23147 {&__pyx_n_s_dict_2, __pyx_k_dict_2,
sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
23148 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23149 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
23150 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23151 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
23152 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
23153 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
23154 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23155 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23156 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
23157 {&__pyx_n_s_getContext, __pyx_k_getContext,
sizeof(__pyx_k_getContext), 0, 0, 1, 1},
23158 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23159 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23160 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
23161 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23162 {&__pyx_n_s_init_cython, __pyx_k_init_cython,
sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
23163 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23164 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23165 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23166 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
23167 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
23168 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
23169 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
23170 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23171 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
23172 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23173 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
23174 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23175 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
23176 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23177 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23178 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23179 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
23180 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
23181 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23182 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
23183 {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py,
sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
23184 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23185 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23186 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23187 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23188 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23189 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23190 {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base,
sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
23191 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23192 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23193 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23194 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23195 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23196 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23197 {&__pyx_n_s_resetBC, __pyx_k_resetBC,
sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
23198 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
23199 {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted,
sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
23200 {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC,
sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
23201 {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda,
sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
23202 {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC,
sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
23203 {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda,
sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
23204 {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp,
sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
23205 {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda,
sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
23206 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23207 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23208 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23209 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
23210 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
23211 {&__pyx_n_s_state, __pyx_k_state,
sizeof(__pyx_k_state), 0, 0, 1, 1},
23212 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
23213 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
23214 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23215 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23216 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23217 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23218 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
23219 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
23220 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
23221 {&__pyx_n_s_t1, __pyx_k_t1,
sizeof(__pyx_k_t1), 0, 0, 1, 1},
23222 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23223 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23224 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23225 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23226 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23227 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
23228 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate,
sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
23229 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
23230 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
23231 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
23232 {0, 0, 0, 0, 0, 0, 0}
23234 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
23235 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum);
if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
23236 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23237 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 777, __pyx_L1_error)
23238 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(3, 781, __pyx_L1_error)
23239 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(3, 959, __pyx_L1_error)
23240 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
23241 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
23242 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
23243 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
23244 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
23245 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
23251 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
23252 __Pyx_RefNannyDeclarations
23253 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
23262 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
23263 __Pyx_GOTREF(__pyx_slice__7);
23264 __Pyx_GIVEREF(__pyx_slice__7);
23272 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
23273 __Pyx_GOTREF(__pyx_tuple__11);
23274 __Pyx_GIVEREF(__pyx_tuple__11);
23281 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
23282 __Pyx_GOTREF(__pyx_tuple__13);
23283 __Pyx_GIVEREF(__pyx_tuple__13);
23292 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 777, __pyx_L1_error)
23293 __Pyx_GOTREF(__pyx_tuple__15);
23294 __Pyx_GIVEREF(__pyx_tuple__15);
23303 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 781, __pyx_L1_error)
23304 __Pyx_GOTREF(__pyx_tuple__16);
23305 __Pyx_GIVEREF(__pyx_tuple__16);
23314 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 801, __pyx_L1_error)
23315 __Pyx_GOTREF(__pyx_tuple__17);
23316 __Pyx_GIVEREF(__pyx_tuple__17);
23325 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 959, __pyx_L1_error)
23326 __Pyx_GOTREF(__pyx_tuple__18);
23327 __Pyx_GIVEREF(__pyx_tuple__18);
23336 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 965, __pyx_L1_error)
23337 __Pyx_GOTREF(__pyx_tuple__19);
23338 __Pyx_GIVEREF(__pyx_tuple__19);
23347 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 133, __pyx_L1_error)
23348 __Pyx_GOTREF(__pyx_tuple__20);
23349 __Pyx_GIVEREF(__pyx_tuple__20);
23358 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 136, __pyx_L1_error)
23359 __Pyx_GOTREF(__pyx_tuple__21);
23360 __Pyx_GIVEREF(__pyx_tuple__21);
23369 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 148, __pyx_L1_error)
23370 __Pyx_GOTREF(__pyx_tuple__22);
23371 __Pyx_GIVEREF(__pyx_tuple__22);
23380 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 176, __pyx_L1_error)
23381 __Pyx_GOTREF(__pyx_tuple__23);
23382 __Pyx_GIVEREF(__pyx_tuple__23);
23391 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 192, __pyx_L1_error)
23392 __Pyx_GOTREF(__pyx_tuple__24);
23393 __Pyx_GIVEREF(__pyx_tuple__24);
23401 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
23402 __Pyx_GOTREF(__pyx_tuple__25);
23403 __Pyx_GIVEREF(__pyx_tuple__25);
23410 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
23411 __Pyx_GOTREF(__pyx_tuple__26);
23412 __Pyx_GIVEREF(__pyx_tuple__26);
23421 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 418, __pyx_L1_error)
23422 __Pyx_GOTREF(__pyx_tuple__27);
23423 __Pyx_GIVEREF(__pyx_tuple__27);
23432 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 495, __pyx_L1_error)
23433 __Pyx_GOTREF(__pyx_tuple__28);
23434 __Pyx_GIVEREF(__pyx_tuple__28);
23443 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 520, __pyx_L1_error)
23444 __Pyx_GOTREF(__pyx_tuple__29);
23445 __Pyx_GIVEREF(__pyx_tuple__29);
23454 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 570, __pyx_L1_error)
23455 __Pyx_GOTREF(__pyx_tuple__30);
23456 __Pyx_GIVEREF(__pyx_tuple__30);
23465 __pyx_tuple__31 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 577, __pyx_L1_error)
23466 __Pyx_GOTREF(__pyx_tuple__31);
23467 __Pyx_INCREF(__pyx_int_neg_1);
23468 __Pyx_GIVEREF(__pyx_int_neg_1);
23469 PyTuple_SET_ITEM(__pyx_tuple__31, 0, __pyx_int_neg_1);
23470 __Pyx_GIVEREF(__pyx_tuple__31);
23478 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error)
23479 __Pyx_GOTREF(__pyx_tuple__32);
23480 __Pyx_GIVEREF(__pyx_tuple__32);
23487 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error)
23488 __Pyx_GOTREF(__pyx_tuple__33);
23489 __Pyx_GIVEREF(__pyx_tuple__33);
23498 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 703, __pyx_L1_error)
23499 __Pyx_GOTREF(__pyx_tuple__34);
23500 __Pyx_GIVEREF(__pyx_tuple__34);
23508 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 2, __pyx_L1_error)
23509 __Pyx_GOTREF(__pyx_tuple__35);
23510 __Pyx_GIVEREF(__pyx_tuple__35);
23517 __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error)
23518 __Pyx_GOTREF(__pyx_tuple__36);
23519 __Pyx_GIVEREF(__pyx_tuple__36);
23528 __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 52, __pyx_L1_error)
23529 __Pyx_GOTREF(__pyx_tuple__38);
23530 __Pyx_GIVEREF(__pyx_tuple__38);
23531 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
23538 __pyx_tuple__39 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 1, __pyx_L1_error)
23539 __Pyx_GOTREF(__pyx_tuple__39);
23540 __Pyx_GIVEREF(__pyx_tuple__39);
23541 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
23549 __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 16, __pyx_L1_error)
23550 __Pyx_GOTREF(__pyx_tuple__40);
23551 __Pyx_GIVEREF(__pyx_tuple__40);
23552 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
23561 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 81, __pyx_L1_error)
23562 __Pyx_GOTREF(__pyx_tuple__41);
23563 __Pyx_GIVEREF(__pyx_tuple__41);
23564 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23573 __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 84, __pyx_L1_error)
23574 __Pyx_GOTREF(__pyx_tuple__42);
23575 __Pyx_GIVEREF(__pyx_tuple__42);
23576 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23585 __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 87, __pyx_L1_error)
23586 __Pyx_GOTREF(__pyx_tuple__43);
23587 __Pyx_GIVEREF(__pyx_tuple__43);
23588 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23597 __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 100, __pyx_L1_error)
23598 __Pyx_GOTREF(__pyx_tuple__44);
23599 __Pyx_GIVEREF(__pyx_tuple__44);
23600 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23609 __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 115, __pyx_L1_error)
23610 __Pyx_GOTREF(__pyx_tuple__45);
23611 __Pyx_GIVEREF(__pyx_tuple__45);
23612 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23619 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error)
23620 __Pyx_GOTREF(__pyx_tuple__46);
23621 __Pyx_GIVEREF(__pyx_tuple__46);
23622 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23630 __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 3, __pyx_L1_error)
23631 __Pyx_GOTREF(__pyx_tuple__47);
23632 __Pyx_GIVEREF(__pyx_tuple__47);
23633 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23640 __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error)
23641 __Pyx_GOTREF(__pyx_tuple__48);
23642 __Pyx_GIVEREF(__pyx_tuple__48);
23643 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23652 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 286, __pyx_L1_error)
23653 __Pyx_GOTREF(__pyx_tuple__49);
23654 __Pyx_GIVEREF(__pyx_tuple__49);
23663 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 287, __pyx_L1_error)
23664 __Pyx_GOTREF(__pyx_tuple__50);
23665 __Pyx_GIVEREF(__pyx_tuple__50);
23674 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 288, __pyx_L1_error)
23675 __Pyx_GOTREF(__pyx_tuple__51);
23676 __Pyx_GIVEREF(__pyx_tuple__51);
23685 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 291, __pyx_L1_error)
23686 __Pyx_GOTREF(__pyx_tuple__52);
23687 __Pyx_GIVEREF(__pyx_tuple__52);
23696 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 292, __pyx_L1_error)
23697 __Pyx_GOTREF(__pyx_tuple__53);
23698 __Pyx_GIVEREF(__pyx_tuple__53);
23705 __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error)
23706 __Pyx_GOTREF(__pyx_tuple__54);
23707 __Pyx_GIVEREF(__pyx_tuple__54);
23708 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 1, __pyx_L1_error)
23709 __Pyx_RefNannyFinishContext();
23712 __Pyx_RefNannyFinishContext();
23716 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23717 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23718 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23719 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23720 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23721 __pyx_int_158231071 = PyInt_FromLong(158231071
L);
if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23722 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23723 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23729 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23730 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23731 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23732 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23733 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23734 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23735 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23737 static int __Pyx_modinit_global_init_code(
void) {
23738 __Pyx_RefNannyDeclarations
23739 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23741 generic = Py_None; Py_INCREF(Py_None);
23742 strided = Py_None; Py_INCREF(Py_None);
23743 indirect = Py_None; Py_INCREF(Py_None);
23744 contiguous = Py_None; Py_INCREF(Py_None);
23745 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23746 __Pyx_RefNannyFinishContext();
23750 static int __Pyx_modinit_variable_export_code(
void) {
23751 __Pyx_RefNannyDeclarations
23752 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23754 __Pyx_RefNannyFinishContext();
23758 static int __Pyx_modinit_function_export_code(
void) {
23759 __Pyx_RefNannyDeclarations
23760 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23762 __Pyx_RefNannyFinishContext();
23766 static int __Pyx_modinit_type_init_code(
void) {
23767 __Pyx_RefNannyDeclarations
23768 int __pyx_lineno = 0;
23769 const char *__pyx_filename = NULL;
23770 int __pyx_clineno = 0;
23771 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23773 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23774 #if PY_VERSION_HEX < 0x030800B1
23775 __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23777 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23778 __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23780 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23781 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23782 __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23783 __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23784 __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23785 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23786 #if PY_VERSION_HEX < 0x030800B1
23787 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23789 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23790 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23792 if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23793 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23794 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23795 __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23796 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23797 #if PY_VERSION_HEX < 0x030800B1
23798 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23800 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23801 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23803 __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23804 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23805 #if PY_VERSION_HEX < 0x030800B1
23806 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23808 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23809 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23811 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23812 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23813 #if PY_VERSION_HEX < 0x030800B1
23814 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23816 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23817 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23819 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23820 __pyx_vtabptr_array = &__pyx_vtable_array;
23821 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23822 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23823 #if PY_VERSION_HEX < 0x030800B1
23824 __pyx_type___pyx_array.tp_print = 0;
23826 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23827 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23828 __pyx_array_type = &__pyx_type___pyx_array;
23829 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23830 #if PY_VERSION_HEX < 0x030800B1
23831 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23833 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23834 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23836 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23837 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23838 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23839 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23840 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23841 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23842 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23843 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23844 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23845 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23846 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23847 #if PY_VERSION_HEX < 0x030800B1
23848 __pyx_type___pyx_memoryview.tp_print = 0;
23850 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23851 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23853 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23854 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23855 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23856 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23857 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23858 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23859 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23860 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23861 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23862 #if PY_VERSION_HEX < 0x030800B1
23863 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23865 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23866 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23868 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23869 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23870 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23871 __Pyx_RefNannyFinishContext();
23874 __Pyx_RefNannyFinishContext();
23878 static int __Pyx_modinit_type_import_code(
void) {
23879 __Pyx_RefNannyDeclarations
23880 PyObject *__pyx_t_1 = NULL;
23881 int __pyx_lineno = 0;
23882 const char *__pyx_filename = NULL;
23883 int __pyx_clineno = 0;
23884 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23886 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
23887 __Pyx_GOTREF(__pyx_t_1);
23888 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23889 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23890 sizeof(PyTypeObject),
23892 sizeof(PyHeapTypeObject),
23894 __Pyx_ImportType_CheckSize_Warn);
23895 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
23896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23897 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 207, __pyx_L1_error)
23898 __Pyx_GOTREF(__pyx_t_1);
23899 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23900 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 207, __pyx_L1_error)
23901 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23902 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 230, __pyx_L1_error)
23903 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23904 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 234, __pyx_L1_error)
23905 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23906 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 246, __pyx_L1_error)
23907 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23908 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 839, __pyx_L1_error)
23909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23910 __Pyx_RefNannyFinishContext();
23913 __Pyx_XDECREF(__pyx_t_1);
23914 __Pyx_RefNannyFinishContext();
23918 static int __Pyx_modinit_variable_import_code(
void) {
23919 __Pyx_RefNannyDeclarations
23920 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23922 __Pyx_RefNannyFinishContext();
23926 static int __Pyx_modinit_function_import_code(
void) {
23927 __Pyx_RefNannyDeclarations
23928 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23930 __Pyx_RefNannyFinishContext();
23935 #ifndef CYTHON_NO_PYINIT_EXPORT
23936 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23937 #elif PY_MAJOR_VERSION < 3
23939 #define __Pyx_PyMODINIT_FUNC extern "C" void
23941 #define __Pyx_PyMODINIT_FUNC void
23945 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23947 #define __Pyx_PyMODINIT_FUNC PyObject *
23952 #if PY_MAJOR_VERSION < 3
23953 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void) CYTHON_SMALL_CODE;
23954 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void)
23956 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void) CYTHON_SMALL_CODE;
23957 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void)
23958 #if CYTHON_PEP489_MULTI_PHASE_INIT
23960 return PyModuleDef_Init(&__pyx_moduledef);
23962 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23963 #if PY_VERSION_HEX >= 0x030700A1
23964 static PY_INT64_T main_interpreter_id = -1;
23965 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23966 if (main_interpreter_id == -1) {
23967 main_interpreter_id = current_id;
23968 return (unlikely(current_id == -1)) ? -1 : 0;
23969 }
else if (unlikely(main_interpreter_id != current_id))
23971 static PyInterpreterState *main_interpreter = NULL;
23972 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23973 if (!main_interpreter) {
23974 main_interpreter = current_interpreter;
23975 }
else if (unlikely(main_interpreter != current_interpreter))
23980 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23985 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
23986 PyObject *value = PyObject_GetAttrString(spec, from_name);
23988 if (likely(value)) {
23989 if (allow_none || value != Py_None) {
23990 result = PyDict_SetItemString(moddict, to_name, value);
23993 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24000 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24001 PyObject *module = NULL, *moddict, *modname;
24002 if (__Pyx_check_single_interpreter())
24005 return __Pyx_NewRef(__pyx_m);
24006 modname = PyObject_GetAttrString(spec,
"name");
24007 if (unlikely(!modname))
goto bad;
24008 module = PyModule_NewObject(modname);
24009 Py_DECREF(modname);
24010 if (unlikely(!module))
goto bad;
24011 moddict = PyModule_GetDict(module);
24012 if (unlikely(!moddict))
goto bad;
24013 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
24014 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
24015 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
24016 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
24019 Py_XDECREF(module);
24024 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
24028 __Pyx_TraceDeclarations
24029 PyObject *__pyx_t_1 = NULL;
24030 static PyThread_type_lock __pyx_t_2[8];
24031 int __pyx_lineno = 0;
24032 const char *__pyx_filename = NULL;
24033 int __pyx_clineno = 0;
24034 __Pyx_RefNannyDeclarations
24035 #if CYTHON_PEP489_MULTI_PHASE_INIT
24037 if (__pyx_m == __pyx_pyinit_module)
return 0;
24038 PyErr_SetString(PyExc_RuntimeError,
"Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
24041 #elif PY_MAJOR_VERSION >= 3
24042 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24044 #if CYTHON_REFNANNY
24045 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24046 if (!__Pyx_RefNanny) {
24048 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24049 if (!__Pyx_RefNanny)
24050 Py_FatalError(
"failed to import 'refnanny' module");
24053 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
24054 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24055 #ifdef __Pxy_PyFrame_Initialize_Offsets
24056 __Pxy_PyFrame_Initialize_Offsets();
24058 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24059 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24060 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24061 #ifdef __Pyx_CyFunction_USED
24062 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24064 #ifdef __Pyx_FusedFunction_USED
24065 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24067 #ifdef __Pyx_Coroutine_USED
24068 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24070 #ifdef __Pyx_Generator_USED
24071 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24073 #ifdef __Pyx_AsyncGen_USED
24074 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24076 #ifdef __Pyx_StopAsyncIteration_USED
24077 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24081 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24083 PyEval_InitThreads();
24087 #if CYTHON_PEP489_MULTI_PHASE_INIT
24088 __pyx_m = __pyx_pyinit_module;
24089 Py_INCREF(__pyx_m);
24091 #if PY_MAJOR_VERSION < 3
24092 __pyx_m = Py_InitModule4(
"BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24094 __pyx_m = PyModule_Create(&__pyx_moduledef);
24096 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24098 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24099 Py_INCREF(__pyx_d);
24100 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24101 Py_INCREF(__pyx_b);
24102 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24103 Py_INCREF(__pyx_cython_runtime);
24104 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24106 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24107 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24108 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24110 if (__pyx_module_is_main_BoundaryConditions) {
24111 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24113 #if PY_MAJOR_VERSION >= 3
24115 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24116 if (!PyDict_GetItemString(modules,
"BoundaryConditions")) {
24117 if (unlikely(PyDict_SetItemString(modules,
"BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24122 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24124 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24126 (void)__Pyx_modinit_global_init_code();
24127 (void)__Pyx_modinit_variable_export_code();
24128 (void)__Pyx_modinit_function_export_code();
24129 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24130 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24131 (void)__Pyx_modinit_variable_import_code();
24132 (void)__Pyx_modinit_function_import_code();
24134 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24135 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24137 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
24146 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
24147 __Pyx_GOTREF(__pyx_t_1);
24148 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
24149 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24158 __pyx_t_1 = PyList_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
24159 __Pyx_GOTREF(__pyx_t_1);
24160 __Pyx_INCREF(__pyx_n_s_BC_Base);
24161 __Pyx_GIVEREF(__pyx_n_s_BC_Base);
24162 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
24163 __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
24164 __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
24165 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
24166 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
24167 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24176 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
24177 __Pyx_GOTREF(__pyx_t_1);
24178 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
24179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24180 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24187 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24188 __Pyx_GOTREF(__pyx_t_1);
24189 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24190 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24191 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24199 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
24200 __Pyx_GOTREF(__pyx_t_1);
24201 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
24202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24203 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24212 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
24213 __Pyx_GOTREF(__pyx_t_1);
24214 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
24215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24216 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24225 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24226 __Pyx_GOTREF(__pyx_t_1);
24227 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24229 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24238 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
24239 __Pyx_GOTREF(__pyx_t_1);
24240 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
24241 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24242 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24251 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
24252 __Pyx_GOTREF(__pyx_t_1);
24253 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
24254 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24255 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24264 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
24265 __Pyx_GOTREF(__pyx_t_1);
24266 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
24267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24268 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24275 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24276 __Pyx_GOTREF(__pyx_t_1);
24277 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24278 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24286 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
24287 __Pyx_GOTREF(__pyx_t_1);
24288 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
24289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24296 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24297 __Pyx_GOTREF(__pyx_t_1);
24298 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24306 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24307 __Pyx_GOTREF(__pyx_t_1);
24308 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24318 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
24319 __Pyx_GOTREF(__pyx_t_1);
24320 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
24321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24322 PyType_Modified(__pyx_array_type);
24331 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24332 __Pyx_GOTREF(__pyx_t_1);
24333 __Pyx_XGOTREF(
generic);
24334 __Pyx_DECREF_SET(
generic, __pyx_t_1);
24335 __Pyx_GIVEREF(__pyx_t_1);
24345 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24346 __Pyx_GOTREF(__pyx_t_1);
24347 __Pyx_XGOTREF(strided);
24348 __Pyx_DECREF_SET(strided, __pyx_t_1);
24349 __Pyx_GIVEREF(__pyx_t_1);
24359 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
24360 __Pyx_GOTREF(__pyx_t_1);
24361 __Pyx_XGOTREF(indirect);
24362 __Pyx_DECREF_SET(indirect, __pyx_t_1);
24363 __Pyx_GIVEREF(__pyx_t_1);
24373 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24374 __Pyx_GOTREF(__pyx_t_1);
24375 __Pyx_XGOTREF(contiguous);
24376 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24377 __Pyx_GIVEREF(__pyx_t_1);
24387 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24388 __Pyx_GOTREF(__pyx_t_1);
24389 __Pyx_XGOTREF(indirect_contiguous);
24390 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24391 __Pyx_GIVEREF(__pyx_t_1);
24401 __pyx_memoryview_thread_locks_used = 0;
24410 __pyx_t_2[0] = PyThread_allocate_lock();
24411 __pyx_t_2[1] = PyThread_allocate_lock();
24412 __pyx_t_2[2] = PyThread_allocate_lock();
24413 __pyx_t_2[3] = PyThread_allocate_lock();
24414 __pyx_t_2[4] = PyThread_allocate_lock();
24415 __pyx_t_2[5] = PyThread_allocate_lock();
24416 __pyx_t_2[6] = PyThread_allocate_lock();
24417 __pyx_t_2[7] = PyThread_allocate_lock();
24418 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24427 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
24428 __Pyx_GOTREF(__pyx_t_1);
24429 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24430 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24431 PyType_Modified(__pyx_memoryview_type);
24440 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24441 __Pyx_GOTREF(__pyx_t_1);
24442 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24444 PyType_Modified(__pyx_memoryviewslice_type);
24451 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24452 __Pyx_GOTREF(__pyx_t_1);
24453 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24463 __Pyx_TraceReturn(Py_None, 0);
24469 __Pyx_XDECREF(__pyx_t_1);
24472 __Pyx_AddTraceback(
"init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24475 }
else if (!PyErr_Occurred()) {
24476 PyErr_SetString(PyExc_ImportError,
"init BoundaryConditions");
24479 __Pyx_RefNannyFinishContext();
24480 #if CYTHON_PEP489_MULTI_PHASE_INIT
24481 return (__pyx_m != NULL) ? 0 : -1;
24482 #elif PY_MAJOR_VERSION >= 3
24491 #if CYTHON_REFNANNY
24492 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24493 PyObject *m = NULL, *p = NULL;
24495 m = PyImport_ImportModule(modname);
24497 p = PyObject_GetAttrString(m,
"RefNannyAPI");
24499 r = PyLong_AsVoidPtr(p);
24503 return (__Pyx_RefNannyAPIStruct *)
r;
24508 #if CYTHON_USE_TYPE_SLOTS
24509 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24510 PyTypeObject* tp = Py_TYPE(obj);
24511 if (likely(tp->tp_getattro))
24512 return tp->tp_getattro(obj, attr_name);
24513 #if PY_MAJOR_VERSION < 3
24514 if (likely(tp->tp_getattr))
24515 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24517 return PyObject_GetAttr(obj, attr_name);
24522 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24523 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24524 if (unlikely(!result)) {
24525 PyErr_Format(PyExc_NameError,
24526 #
if PY_MAJOR_VERSION >= 3
24527 "name '%U' is not defined", name);
24529 "name '%.200s' is not defined", PyString_AS_STRING(name));
24536 static void __Pyx_RaiseDoubleKeywordsError(
24537 const char* func_name,
24540 PyErr_Format(PyExc_TypeError,
24541 #
if PY_MAJOR_VERSION >= 3
24542 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24544 "%s() got multiple values for keyword argument '%s'", func_name,
24545 PyString_AsString(kw_name));
24550 static int __Pyx_ParseOptionalKeywords(
24552 PyObject **argnames[],
24554 PyObject *values[],
24555 Py_ssize_t num_pos_args,
24556 const char* function_name)
24558 PyObject *key = 0, *value = 0;
24559 Py_ssize_t
pos = 0;
24561 PyObject*** first_kw_arg = argnames + num_pos_args;
24562 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24563 name = first_kw_arg;
24564 while (*name && (**name != key)) name++;
24566 values[name-argnames] = value;
24569 name = first_kw_arg;
24570 #if PY_MAJOR_VERSION < 3
24571 if (likely(PyString_Check(key))) {
24573 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24574 && _PyString_Eq(**name, key)) {
24575 values[name-argnames] = value;
24580 if (*name)
continue;
24582 PyObject*** argname = argnames;
24583 while (argname != first_kw_arg) {
24584 if ((**argname == key) || (
24585 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24586 && _PyString_Eq(**argname, key))) {
24587 goto arg_passed_twice;
24594 if (likely(PyUnicode_Check(key))) {
24596 int cmp = (**name == key) ? 0 :
24597 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24598 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24600 PyUnicode_Compare(**name, key);
24601 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24603 values[name-argnames] = value;
24608 if (*name)
continue;
24610 PyObject*** argname = argnames;
24611 while (argname != first_kw_arg) {
24612 int cmp = (**argname == key) ? 0 :
24613 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24614 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24616 PyUnicode_Compare(**argname, key);
24617 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24618 if (cmp == 0)
goto arg_passed_twice;
24623 goto invalid_keyword_type;
24625 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24627 goto invalid_keyword;
24632 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24634 invalid_keyword_type:
24635 PyErr_Format(PyExc_TypeError,
24636 "%.200s() keywords must be strings", function_name);
24639 PyErr_Format(PyExc_TypeError,
24640 #
if PY_MAJOR_VERSION < 3
24641 "%.200s() got an unexpected keyword argument '%.200s'",
24642 function_name, PyString_AsString(key));
24644 "%s() got an unexpected keyword argument '%U'",
24645 function_name, key);
24652 static void __Pyx_RaiseArgtupleInvalid(
24653 const char* func_name,
24655 Py_ssize_t num_min,
24656 Py_ssize_t num_max,
24657 Py_ssize_t num_found)
24659 Py_ssize_t num_expected;
24660 const char *more_or_less;
24661 if (num_found < num_min) {
24662 num_expected = num_min;
24663 more_or_less =
"at least";
24665 num_expected = num_max;
24666 more_or_less =
"at most";
24669 more_or_less =
"exactly";
24671 PyErr_Format(PyExc_TypeError,
24672 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24673 func_name, more_or_less, num_expected,
24674 (num_expected == 1) ?
"" :
"s", num_found);
24678 #if CYTHON_FAST_THREAD_STATE
24679 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24680 PyObject *tmp_type, *tmp_value, *tmp_tb;
24681 tmp_type = tstate->curexc_type;
24682 tmp_value = tstate->curexc_value;
24683 tmp_tb = tstate->curexc_traceback;
24684 tstate->curexc_type = type;
24685 tstate->curexc_value = value;
24686 tstate->curexc_traceback = tb;
24687 Py_XDECREF(tmp_type);
24688 Py_XDECREF(tmp_value);
24689 Py_XDECREF(tmp_tb);
24691 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24692 *type = tstate->curexc_type;
24693 *value = tstate->curexc_value;
24694 *tb = tstate->curexc_traceback;
24695 tstate->curexc_type = 0;
24696 tstate->curexc_value = 0;
24697 tstate->curexc_traceback = 0;
24703 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24704 PyFrameObject** frame,
24705 PyThreadState* tstate,
24706 const char *funcname,
24707 const char *srcfile,
24709 PyObject *type, *value, *traceback;
24711 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24712 if (*code == NULL) {
24713 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24714 if (*code == NULL)
return 0;
24716 *frame = PyFrame_New(
24722 if (*frame == NULL)
return 0;
24723 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24724 Py_INCREF(Py_None);
24725 (*frame)->f_trace = Py_None;
24727 #if PY_VERSION_HEX < 0x030400B1
24729 (*frame)->f_tstate = tstate;
24732 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24735 tstate->use_tracing = 0;
24736 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24738 if (tstate->c_tracefunc)
24739 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24740 if (retval && tstate->c_profilefunc)
24742 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24743 tstate->use_tracing = (tstate->c_profilefunc ||
24744 (CYTHON_TRACE && tstate->c_tracefunc));
24747 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24748 return tstate->use_tracing && retval;
24752 Py_XDECREF(traceback);
24756 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
24757 PyCodeObject *py_code = 0;
24758 #if PY_MAJOR_VERSION >= 3
24759 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24760 if (likely(py_code)) {
24761 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24764 PyObject *py_srcfile = 0;
24765 PyObject *py_funcname = 0;
24766 py_funcname = PyString_FromString(funcname);
24767 if (unlikely(!py_funcname))
goto bad;
24768 py_srcfile = PyString_FromString(srcfile);
24769 if (unlikely(!py_srcfile))
goto bad;
24770 py_code = PyCode_New(
24774 CO_OPTIMIZED | CO_NEWLOCALS,
24787 Py_XDECREF(py_srcfile);
24788 Py_XDECREF(py_funcname);
24795 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24797 if (!j)
return NULL;
24798 r = PyObject_GetItem(o, j);
24802 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24803 CYTHON_NCP_UNUSED
int wraparound,
24804 CYTHON_NCP_UNUSED
int boundscheck) {
24805 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24806 Py_ssize_t wrapped_i = i;
24807 if (wraparound & unlikely(i < 0)) {
24808 wrapped_i += PyList_GET_SIZE(o);
24810 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24811 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24815 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24817 return PySequence_GetItem(o, i);
24820 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24821 CYTHON_NCP_UNUSED
int wraparound,
24822 CYTHON_NCP_UNUSED
int boundscheck) {
24823 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24824 Py_ssize_t wrapped_i = i;
24825 if (wraparound & unlikely(i < 0)) {
24826 wrapped_i += PyTuple_GET_SIZE(o);
24828 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24829 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24833 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24835 return PySequence_GetItem(o, i);
24838 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24839 CYTHON_NCP_UNUSED
int wraparound,
24840 CYTHON_NCP_UNUSED
int boundscheck) {
24841 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24842 if (is_list || PyList_CheckExact(o)) {
24843 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24844 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24845 PyObject *
r = PyList_GET_ITEM(o,
n);
24850 else if (PyTuple_CheckExact(o)) {
24851 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24852 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24853 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24858 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24859 if (likely(m && m->sq_item)) {
24860 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24861 Py_ssize_t l = m->sq_length(o);
24862 if (likely(l >= 0)) {
24865 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24870 return m->sq_item(o, i);
24874 if (is_list || PySequence_Check(o)) {
24875 return PySequence_GetItem(o, i);
24878 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24882 #if CYTHON_USE_TYPE_SLOTS
24883 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24885 Py_ssize_t key_value;
24886 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24887 if (unlikely(!(m && m->sq_item))) {
24888 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24891 key_value = __Pyx_PyIndex_AsSsize_t(index);
24892 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24893 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24895 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24897 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24901 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24902 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24903 if (likely(m && m->mp_subscript)) {
24904 return m->mp_subscript(obj, key);
24906 return __Pyx_PyObject_GetIndex(obj, key);
24912 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24914 __Pyx_memviewslice *memviewslice,
24915 int memview_is_new_reference)
24917 __Pyx_RefNannyDeclarations
24919 Py_buffer *buf = &memview->view;
24920 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24921 if (unlikely(memviewslice->memview || memviewslice->data)) {
24922 PyErr_SetString(PyExc_ValueError,
24923 "memviewslice is already initialized!");
24926 if (buf->strides) {
24927 for (i = 0; i < ndim; i++) {
24928 memviewslice->strides[i] = buf->strides[i];
24931 Py_ssize_t stride = buf->itemsize;
24932 for (i = ndim - 1; i >= 0; i--) {
24933 memviewslice->strides[i] = stride;
24934 stride *= buf->shape[i];
24937 for (i = 0; i < ndim; i++) {
24938 memviewslice->shape[i] = buf->shape[i];
24939 if (buf->suboffsets) {
24940 memviewslice->suboffsets[i] = buf->suboffsets[i];
24942 memviewslice->suboffsets[i] = -1;
24945 memviewslice->memview = memview;
24946 memviewslice->data = (
char *)buf->buf;
24947 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24948 Py_INCREF(memview);
24953 memviewslice->memview = 0;
24954 memviewslice->data = 0;
24957 __Pyx_RefNannyFinishContext();
24960 #ifndef Py_NO_RETURN
24961 #define Py_NO_RETURN
24963 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24966 #ifdef HAVE_STDARG_PROTOTYPES
24967 va_start(vargs, fmt);
24971 vsnprintf(msg, 200, fmt, vargs);
24973 Py_FatalError(msg);
24975 static CYTHON_INLINE
int
24976 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24977 PyThread_type_lock lock)
24980 PyThread_acquire_lock(lock, 1);
24981 result = (*acquisition_count)++;
24982 PyThread_release_lock(lock);
24985 static CYTHON_INLINE
int
24986 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24987 PyThread_type_lock lock)
24990 PyThread_acquire_lock(lock, 1);
24991 result = (*acquisition_count)--;
24992 PyThread_release_lock(lock);
24995 static CYTHON_INLINE
void
24996 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24999 struct __pyx_memoryview_obj *memview = memslice->memview;
25000 if (unlikely(!memview || (PyObject *) memview == Py_None))
25002 if (unlikely(__pyx_get_slice_count(memview) < 0))
25003 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25004 __pyx_get_slice_count(memview), lineno);
25005 first_time = __pyx_add_acquisition_count(memview) == 0;
25006 if (unlikely(first_time)) {
25008 Py_INCREF((PyObject *) memview);
25010 PyGILState_STATE _gilstate = PyGILState_Ensure();
25011 Py_INCREF((PyObject *) memview);
25012 PyGILState_Release(_gilstate);
25016 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25017 int have_gil,
int lineno) {
25019 struct __pyx_memoryview_obj *memview = memslice->memview;
25020 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
25021 memslice->memview = NULL;
25024 if (unlikely(__pyx_get_slice_count(memview) <= 0))
25025 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25026 __pyx_get_slice_count(memview), lineno);
25027 last_time = __pyx_sub_acquisition_count(memview) == 1;
25028 memslice->data = NULL;
25029 if (unlikely(last_time)) {
25031 Py_CLEAR(memslice->memview);
25033 PyGILState_STATE _gilstate = PyGILState_Ensure();
25034 Py_CLEAR(memslice->memview);
25035 PyGILState_Release(_gilstate);
25038 memslice->memview = NULL;
25043 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25044 PyObject *empty_list = 0;
25045 PyObject *module = 0;
25046 PyObject *global_dict = 0;
25047 PyObject *empty_dict = 0;
25049 #if PY_MAJOR_VERSION < 3
25050 PyObject *py_import;
25051 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25058 empty_list = PyList_New(0);
25063 global_dict = PyModule_GetDict(__pyx_m);
25066 empty_dict = PyDict_New();
25070 #if PY_MAJOR_VERSION >= 3
25072 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25073 module = PyImport_ImportModuleLevelObject(
25074 name, global_dict, empty_dict, list, 1);
25076 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25085 #if PY_MAJOR_VERSION < 3
25086 PyObject *py_level = PyInt_FromLong(level);
25089 module = PyObject_CallFunctionObjArgs(py_import,
25090 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25091 Py_DECREF(py_level);
25093 module = PyImport_ImportModuleLevelObject(
25094 name, global_dict, empty_dict, list, level);
25099 #if PY_MAJOR_VERSION < 3
25100 Py_XDECREF(py_import);
25102 Py_XDECREF(empty_list);
25103 Py_XDECREF(empty_dict);
25108 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25109 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25110 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25111 PyErr_Format(PyExc_ImportError,
25112 #
if PY_MAJOR_VERSION < 3
25113 "cannot import name %.230s", PyString_AS_STRING(name));
25115 "cannot import name %S", name);
25122 #if CYTHON_FAST_PYCALL
25123 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
25124 PyObject *globals) {
25126 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25127 PyObject **fastlocals;
25130 assert(globals != NULL);
25135 assert(tstate != NULL);
25136 f = PyFrame_New(tstate, co, globals, NULL);
25140 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
25141 for (i = 0; i < na; i++) {
25143 fastlocals[i] = *args++;
25145 result = PyEval_EvalFrameEx(
f,0);
25146 ++tstate->recursion_depth;
25148 --tstate->recursion_depth;
25151 #if 1 || PY_VERSION_HEX < 0x030600B1
25152 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
25153 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
25154 PyObject *globals = PyFunction_GET_GLOBALS(func);
25155 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
25157 #if PY_MAJOR_VERSION >= 3
25160 PyObject *kwtuple, **k;
25165 assert(kwargs == NULL || PyDict_Check(kwargs));
25166 nk = kwargs ? PyDict_Size(kwargs) : 0;
25167 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
25171 #
if PY_MAJOR_VERSION >= 3
25172 co->co_kwonlyargcount == 0 &&
25174 likely(kwargs == NULL || nk == 0) &&
25175 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
25176 if (argdefs == NULL && co->co_argcount == nargs) {
25177 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
25180 else if (nargs == 0 && argdefs != NULL
25181 && co->co_argcount == Py_SIZE(argdefs)) {
25184 args = &PyTuple_GET_ITEM(argdefs, 0);
25185 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
25189 if (kwargs != NULL) {
25191 kwtuple = PyTuple_New(2 * nk);
25192 if (kwtuple == NULL) {
25196 k = &PyTuple_GET_ITEM(kwtuple, 0);
25198 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
25209 closure = PyFunction_GET_CLOSURE(func);
25210 #if PY_MAJOR_VERSION >= 3
25211 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
25213 if (argdefs != NULL) {
25214 d = &PyTuple_GET_ITEM(argdefs, 0);
25215 nd = Py_SIZE(argdefs);
25221 #if PY_MAJOR_VERSION >= 3
25222 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
25225 d, (
int)nd, kwdefs, closure);
25227 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
25230 d, (
int)nd, closure);
25232 Py_XDECREF(kwtuple);
25234 Py_LeaveRecursiveCall();
25241 #if CYTHON_COMPILING_IN_CPYTHON
25242 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25244 ternaryfunc call = func->ob_type->tp_call;
25245 if (unlikely(!call))
25246 return PyObject_Call(func, arg, kw);
25247 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25249 result = (*call)(func, arg, kw);
25250 Py_LeaveRecursiveCall();
25251 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25254 "NULL result without error in PyObject_Call");
25261 #if CYTHON_COMPILING_IN_CPYTHON
25262 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25263 PyObject *
self, *result;
25265 cfunc = PyCFunction_GET_FUNCTION(func);
25266 self = PyCFunction_GET_SELF(func);
25267 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25269 result = cfunc(
self, arg);
25270 Py_LeaveRecursiveCall();
25271 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25274 "NULL result without error in PyObject_Call");
25281 #if CYTHON_COMPILING_IN_CPYTHON
25282 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
25283 #if CYTHON_FAST_PYCALL
25284 if (PyFunction_Check(func)) {
25285 return __Pyx_PyFunction_FastCall(func, NULL, 0);
25288 #ifdef __Pyx_CyFunction_USED
25289 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
25291 if (likely(PyCFunction_Check(func)))
25294 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
25295 return __Pyx_PyObject_CallMethO(func, NULL);
25298 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
25303 #if CYTHON_FAST_PYCCALL
25304 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
25305 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
25306 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
25307 PyObject *
self = PyCFunction_GET_SELF(func);
25308 int flags = PyCFunction_GET_FLAGS(func);
25309 assert(PyCFunction_Check(func));
25310 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
25311 assert(nargs >= 0);
25312 assert(nargs == 0 || args != NULL);
25316 assert(!PyErr_Occurred());
25317 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
25318 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
25320 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
25326 #if CYTHON_COMPILING_IN_CPYTHON
25327 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25329 PyObject *args = PyTuple_New(1);
25330 if (unlikely(!args))
return NULL;
25332 PyTuple_SET_ITEM(args, 0, arg);
25333 result = __Pyx_PyObject_Call(func, args, NULL);
25337 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25338 #if CYTHON_FAST_PYCALL
25339 if (PyFunction_Check(func)) {
25340 return __Pyx_PyFunction_FastCall(func, &arg, 1);
25343 if (likely(PyCFunction_Check(func))) {
25344 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
25345 return __Pyx_PyObject_CallMethO(func, arg);
25346 #if CYTHON_FAST_PYCCALL
25347 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
25348 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
25352 return __Pyx__PyObject_CallOneArg(func, arg);
25355 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25357 PyObject *args = PyTuple_Pack(1, arg);
25358 if (unlikely(!args))
return NULL;
25359 result = __Pyx_PyObject_Call(func, args, NULL);
25366 #if CYTHON_FAST_THREAD_STATE
25367 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25369 n = PyTuple_GET_SIZE(tuple);
25370 #if PY_MAJOR_VERSION >= 3
25371 for (i=0; i<
n; i++) {
25372 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25375 for (i=0; i<
n; i++) {
25376 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25380 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25381 PyObject *exc_type = tstate->curexc_type;
25382 if (exc_type == err)
return 1;
25383 if (unlikely(!exc_type))
return 0;
25384 if (unlikely(PyTuple_Check(err)))
25385 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25386 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25391 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25392 #if CYTHON_USE_TYPE_SLOTS
25393 #if PY_MAJOR_VERSION >= 3
25394 if (likely(PyUnicode_Check(
n)))
25396 if (likely(PyString_Check(
n)))
25398 return __Pyx_PyObject_GetAttrStr(o,
n);
25400 return PyObject_GetAttr(o,
n);
25404 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25405 __Pyx_PyThreadState_declare
25406 __Pyx_PyThreadState_assign
25407 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25409 __Pyx_PyErr_Clear();
25413 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25414 PyObject *
r = __Pyx_GetAttr(o,
n);
25415 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25419 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25420 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25421 PyObject *dict = Py_TYPE(obj)->tp_dict;
25422 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25424 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25425 PyObject **dictptr = NULL;
25426 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25428 #if CYTHON_COMPILING_IN_CPYTHON
25429 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
25431 dictptr = _PyObject_GetDictPtr(obj);
25434 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25436 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25437 PyObject *dict = Py_TYPE(obj)->tp_dict;
25438 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25440 return obj_dict_version == __Pyx_get_object_dict_version(obj);
25445 #if CYTHON_USE_DICT_VERSIONS
25446 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25448 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25452 #if !CYTHON_AVOID_BORROWED_REFS
25453 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25454 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25455 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25456 if (likely(result)) {
25457 return __Pyx_NewRef(result);
25458 }
else if (unlikely(PyErr_Occurred())) {
25462 result = PyDict_GetItem(__pyx_d, name);
25463 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25464 if (likely(result)) {
25465 return __Pyx_NewRef(result);
25469 result = PyObject_GetItem(__pyx_d, name);
25470 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25471 if (likely(result)) {
25472 return __Pyx_NewRef(result);
25476 return __Pyx_GetBuiltinName(name);
25480 static int __Pyx_CheckKeywordStrings(
25482 const char* function_name,
25486 Py_ssize_t
pos = 0;
25487 #if CYTHON_COMPILING_IN_PYPY
25488 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
25489 goto invalid_keyword;
25492 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
25493 #if PY_MAJOR_VERSION < 3
25494 if (unlikely(!PyString_Check(key)))
25496 if (unlikely(!PyUnicode_Check(key)))
25497 goto invalid_keyword_type;
25499 if ((!kw_allowed) && unlikely(key))
25500 goto invalid_keyword;
25502 invalid_keyword_type:
25503 PyErr_Format(PyExc_TypeError,
25504 "%.200s() keywords must be strings", function_name);
25508 PyErr_Format(PyExc_TypeError,
25509 #
if PY_MAJOR_VERSION < 3
25510 "%.200s() got an unexpected keyword argument '%.200s'",
25511 function_name, PyString_AsString(key));
25513 "%s() got an unexpected keyword argument '%U'",
25514 function_name, key);
25520 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25521 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25522 int full_traceback, CYTHON_UNUSED
int nogil) {
25523 PyObject *old_exc, *old_val, *old_tb;
25525 __Pyx_PyThreadState_declare
25527 PyGILState_STATE state;
25529 state = PyGILState_Ensure();
25531 else state = (PyGILState_STATE)-1;
25534 __Pyx_PyThreadState_assign
25535 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25536 if (full_traceback) {
25537 Py_XINCREF(old_exc);
25538 Py_XINCREF(old_val);
25539 Py_XINCREF(old_tb);
25540 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25543 #if PY_MAJOR_VERSION < 3
25544 ctx = PyString_FromString(name);
25546 ctx = PyUnicode_FromString(name);
25548 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25550 PyErr_WriteUnraisable(Py_None);
25552 PyErr_WriteUnraisable(ctx);
25557 PyGILState_Release(state);
25562 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
25563 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
25567 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25568 PyObject* fake_module;
25569 PyTypeObject* cached_type = NULL;
25570 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25571 if (!fake_module)
return NULL;
25572 Py_INCREF(fake_module);
25573 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25575 if (!PyType_Check((PyObject*)cached_type)) {
25576 PyErr_Format(PyExc_TypeError,
25577 "Shared Cython type %.200s is not a type object",
25581 if (cached_type->tp_basicsize != type->tp_basicsize) {
25582 PyErr_Format(PyExc_TypeError,
25583 "Shared Cython type %.200s has the wrong size, try recompiling",
25588 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25590 if (PyType_Ready(type) < 0)
goto bad;
25591 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25594 cached_type = type;
25597 Py_DECREF(fake_module);
25598 return cached_type;
25600 Py_XDECREF(cached_type);
25601 cached_type = NULL;
25606 #include <structmember.h>
25608 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25610 if (unlikely(op->func_doc == NULL)) {
25611 if (op->func.m_ml->ml_doc) {
25612 #if PY_MAJOR_VERSION >= 3
25613 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25615 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25617 if (unlikely(op->func_doc == NULL))
25620 Py_INCREF(Py_None);
25624 Py_INCREF(op->func_doc);
25625 return op->func_doc;
25628 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25630 PyObject *tmp = op->func_doc;
25631 if (value == NULL) {
25635 op->func_doc = value;
25640 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25642 if (unlikely(op->func_name == NULL)) {
25643 #if PY_MAJOR_VERSION >= 3
25644 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25646 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25648 if (unlikely(op->func_name == NULL))
25651 Py_INCREF(op->func_name);
25652 return op->func_name;
25655 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25658 #if PY_MAJOR_VERSION >= 3
25659 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25661 if (unlikely(value == NULL || !PyString_Check(value)))
25664 PyErr_SetString(PyExc_TypeError,
25665 "__name__ must be set to a string object");
25668 tmp = op->func_name;
25670 op->func_name = value;
25675 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25677 Py_INCREF(op->func_qualname);
25678 return op->func_qualname;
25681 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25684 #if PY_MAJOR_VERSION >= 3
25685 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25687 if (unlikely(value == NULL || !PyString_Check(value)))
25690 PyErr_SetString(PyExc_TypeError,
25691 "__qualname__ must be set to a string object");
25694 tmp = op->func_qualname;
25696 op->func_qualname = value;
25701 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25704 self = m->func_closure;
25711 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25713 if (unlikely(op->func_dict == NULL)) {
25714 op->func_dict = PyDict_New();
25715 if (unlikely(op->func_dict == NULL))
25718 Py_INCREF(op->func_dict);
25719 return op->func_dict;
25722 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25725 if (unlikely(value == NULL)) {
25726 PyErr_SetString(PyExc_TypeError,
25727 "function's dictionary may not be deleted");
25730 if (unlikely(!PyDict_Check(value))) {
25731 PyErr_SetString(PyExc_TypeError,
25732 "setting function's dictionary to a non-dict");
25735 tmp = op->func_dict;
25737 op->func_dict = value;
25742 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25744 Py_INCREF(op->func_globals);
25745 return op->func_globals;
25748 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25750 Py_INCREF(Py_None);
25754 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25756 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25761 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25763 PyObject *res = op->defaults_getter((PyObject *) op);
25764 if (unlikely(!res))
25766 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25767 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25768 Py_INCREF(op->defaults_tuple);
25769 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25770 Py_INCREF(op->defaults_kwdict);
25772 op->defaults_tuple = PySequence_ITEM(res, 0);
25773 if (unlikely(!op->defaults_tuple)) result = -1;
25775 op->defaults_kwdict = PySequence_ITEM(res, 1);
25776 if (unlikely(!op->defaults_kwdict)) result = -1;
25783 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25787 }
else if (value != Py_None && !PyTuple_Check(value)) {
25788 PyErr_SetString(PyExc_TypeError,
25789 "__defaults__ must be set to a tuple object");
25793 tmp = op->defaults_tuple;
25794 op->defaults_tuple = value;
25799 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25800 PyObject* result = op->defaults_tuple;
25801 if (unlikely(!result)) {
25802 if (op->defaults_getter) {
25803 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25804 result = op->defaults_tuple;
25813 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25817 }
else if (value != Py_None && !PyDict_Check(value)) {
25818 PyErr_SetString(PyExc_TypeError,
25819 "__kwdefaults__ must be set to a dict object");
25823 tmp = op->defaults_kwdict;
25824 op->defaults_kwdict = value;
25829 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25830 PyObject* result = op->defaults_kwdict;
25831 if (unlikely(!result)) {
25832 if (op->defaults_getter) {
25833 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25834 result = op->defaults_kwdict;
25843 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25845 if (!value || value == Py_None) {
25847 }
else if (!PyDict_Check(value)) {
25848 PyErr_SetString(PyExc_TypeError,
25849 "__annotations__ must be set to a dict object");
25853 tmp = op->func_annotations;
25854 op->func_annotations = value;
25859 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25860 PyObject* result = op->func_annotations;
25861 if (unlikely(!result)) {
25862 result = PyDict_New();
25863 if (unlikely(!result))
return NULL;
25864 op->func_annotations = result;
25869 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25870 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25871 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25872 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25873 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25874 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25875 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25876 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25877 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25878 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25879 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25880 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25881 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25882 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25883 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25884 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25885 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25886 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25887 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25890 static PyMemberDef __pyx_CyFunction_members[] = {
25891 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25895 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25897 #if PY_MAJOR_VERSION >= 3
25898 return PyUnicode_FromString(m->func.m_ml->ml_name);
25900 return PyString_FromString(m->func.m_ml->ml_name);
25903 static PyMethodDef __pyx_CyFunction_methods[] = {
25904 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25907 #if PY_VERSION_HEX < 0x030500A0
25908 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25910 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25912 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
25913 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25914 if (unlikely(op == NULL))
25917 __Pyx_CyFunction_weakreflist(op) = NULL;
25918 op->func.m_ml = ml;
25919 op->func.m_self = (PyObject *) op;
25920 Py_XINCREF(closure);
25921 op->func_closure = closure;
25922 Py_XINCREF(module);
25923 op->func.m_module = module;
25924 op->func_dict = NULL;
25925 op->func_name = NULL;
25926 Py_INCREF(qualname);
25927 op->func_qualname = qualname;
25928 op->func_doc = NULL;
25929 op->func_classobj = NULL;
25930 op->func_globals = globals;
25931 Py_INCREF(op->func_globals);
25933 op->func_code = code;
25934 op->defaults_pyobjects = 0;
25935 op->defaults_size = 0;
25936 op->defaults = NULL;
25937 op->defaults_tuple = NULL;
25938 op->defaults_kwdict = NULL;
25939 op->defaults_getter = NULL;
25940 op->func_annotations = NULL;
25941 return (PyObject *) op;
25944 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25946 Py_CLEAR(m->func_closure);
25947 Py_CLEAR(m->func.m_module);
25948 Py_CLEAR(m->func_dict);
25949 Py_CLEAR(m->func_name);
25950 Py_CLEAR(m->func_qualname);
25951 Py_CLEAR(m->func_doc);
25952 Py_CLEAR(m->func_globals);
25953 Py_CLEAR(m->func_code);
25954 Py_CLEAR(m->func_classobj);
25955 Py_CLEAR(m->defaults_tuple);
25956 Py_CLEAR(m->defaults_kwdict);
25957 Py_CLEAR(m->func_annotations);
25959 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25961 for (i = 0; i < m->defaults_pyobjects; i++)
25962 Py_XDECREF(pydefaults[i]);
25963 PyObject_Free(m->defaults);
25964 m->defaults = NULL;
25968 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25970 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25971 PyObject_ClearWeakRefs((PyObject *) m);
25972 __Pyx_CyFunction_clear(m);
25973 PyObject_GC_Del(m);
25975 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25977 PyObject_GC_UnTrack(m);
25978 __Pyx__CyFunction_dealloc(m);
25980 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25982 Py_VISIT(m->func_closure);
25983 Py_VISIT(m->func.m_module);
25984 Py_VISIT(m->func_dict);
25985 Py_VISIT(m->func_name);
25986 Py_VISIT(m->func_qualname);
25987 Py_VISIT(m->func_doc);
25988 Py_VISIT(m->func_globals);
25989 Py_VISIT(m->func_code);
25990 Py_VISIT(m->func_classobj);
25991 Py_VISIT(m->defaults_tuple);
25992 Py_VISIT(m->defaults_kwdict);
25994 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25996 for (i = 0; i < m->defaults_pyobjects; i++)
25997 Py_VISIT(pydefaults[i]);
26001 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26003 #if PY_MAJOR_VERSION < 3
26004 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26005 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26009 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26011 type = (PyObject *)(Py_TYPE(obj));
26012 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26014 if (obj == Py_None)
26017 return __Pyx_PyMethod_New(func, obj, type);
26020 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26022 #if PY_MAJOR_VERSION >= 3
26023 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26024 op->func_qualname, (
void *)op);
26026 return PyString_FromFormat(
"<cyfunction %s at %p>",
26027 PyString_AsString(op->func_qualname), (
void *)op);
26030 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26031 PyCFunctionObject*
f = (PyCFunctionObject*)func;
26032 PyCFunction meth =
f->m_ml->ml_meth;
26034 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26036 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26037 return (*meth)(
self, arg);
26039 case METH_VARARGS | METH_KEYWORDS:
26040 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26042 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26043 size = PyTuple_GET_SIZE(arg);
26044 if (likely(size == 0))
26045 return (*meth)(
self, NULL);
26046 PyErr_Format(PyExc_TypeError,
26047 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26048 f->m_ml->ml_name, size);
26053 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26054 size = PyTuple_GET_SIZE(arg);
26055 if (likely(size == 1)) {
26056 PyObject *result, *arg0;
26057 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26058 arg0 = PyTuple_GET_ITEM(arg, 0);
26060 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26062 result = (*meth)(
self, arg0);
26063 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26068 PyErr_Format(PyExc_TypeError,
26069 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26070 f->m_ml->ml_name, size);
26075 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26076 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26077 "longer supported!");
26080 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26084 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26085 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26087 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26089 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26090 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26092 PyObject *new_args;
26094 argc = PyTuple_GET_SIZE(args);
26095 new_args = PyTuple_GetSlice(args, 1, argc);
26096 if (unlikely(!new_args))
26098 self = PyTuple_GetItem(args, 0);
26099 if (unlikely(!
self)) {
26100 Py_DECREF(new_args);
26103 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26104 Py_DECREF(new_args);
26106 result = __Pyx_CyFunction_Call(func, args, kw);
26110 static PyTypeObject __pyx_CyFunctionType_type = {
26111 PyVarObject_HEAD_INIT(0, 0)
26112 "cython_function_or_method",
26113 sizeof(__pyx_CyFunctionObject),
26115 (destructor) __Pyx_CyFunction_dealloc,
26119 #if PY_MAJOR_VERSION < 3
26124 (reprfunc) __Pyx_CyFunction_repr,
26129 __Pyx_CyFunction_CallAsMethod,
26134 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26136 (traverseproc) __Pyx_CyFunction_traverse,
26137 (inquiry) __Pyx_CyFunction_clear,
26139 #
if PY_VERSION_HEX < 0x030500A0
26140 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26142 offsetof(PyCFunctionObject, m_weakreflist),
26146 __pyx_CyFunction_methods,
26147 __pyx_CyFunction_members,
26148 __pyx_CyFunction_getsets,
26151 __Pyx_CyFunction_descr_get,
26153 offsetof(__pyx_CyFunctionObject, func_dict),
26166 #if PY_VERSION_HEX >= 0x030400a1
26169 #if PY_VERSION_HEX >= 0x030800b1
26172 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26176 static int __pyx_CyFunction_init(
void) {
26177 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26178 if (unlikely(__pyx_CyFunctionType == NULL)) {
26183 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26184 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26185 m->defaults = PyObject_Malloc(size);
26186 if (unlikely(!m->defaults))
26187 return PyErr_NoMemory();
26188 memset(m->defaults, 0, size);
26189 m->defaults_pyobjects = pyobjects;
26190 m->defaults_size = size;
26191 return m->defaults;
26193 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26194 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26195 m->defaults_tuple = tuple;
26198 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26199 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26200 m->defaults_kwdict = dict;
26203 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26204 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26205 m->func_annotations = dict;
26210 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
26211 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26212 PyObject *op = __Pyx_CyFunction_Init(
26213 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26214 ml, flags, qualname, closure, module, globals, code
26217 PyObject_GC_Track(op);
26223 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
26224 PyObject *args, *result = NULL;
26225 #if CYTHON_FAST_PYCALL
26226 if (PyFunction_Check(
function)) {
26227 PyObject *args[2] = {arg1, arg2};
26228 return __Pyx_PyFunction_FastCall(
function, args, 2);
26231 #if CYTHON_FAST_PYCCALL
26232 if (__Pyx_PyFastCFunction_Check(
function)) {
26233 PyObject *args[2] = {arg1, arg2};
26234 return __Pyx_PyCFunction_FastCall(
function, args, 2);
26237 args = PyTuple_New(2);
26238 if (unlikely(!args))
goto done;
26240 PyTuple_SET_ITEM(args, 0, arg1);
26242 PyTuple_SET_ITEM(args, 1, arg2);
26243 Py_INCREF(
function);
26244 result = __Pyx_PyObject_Call(
function, args, NULL);
26246 Py_DECREF(
function);
26252 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
26253 Py_ssize_t cstart, Py_ssize_t cstop,
26254 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
26255 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
26256 #if CYTHON_USE_TYPE_SLOTS
26257 PyMappingMethods* mp;
26258 #if PY_MAJOR_VERSION < 3
26259 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
26260 if (likely(ms && ms->sq_slice)) {
26262 if (_py_start && (*_py_start != Py_None)) {
26263 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
26264 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
26269 if (_py_stop && (*_py_stop != Py_None)) {
26270 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
26271 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
26273 cstop = PY_SSIZE_T_MAX;
26275 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
26276 Py_ssize_t l = ms->sq_length(obj);
26277 if (likely(l >= 0)) {
26280 if (cstop < 0) cstop = 0;
26284 if (cstart < 0) cstart = 0;
26287 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
26292 return ms->sq_slice(obj, cstart, cstop);
26295 mp = Py_TYPE(obj)->tp_as_mapping;
26296 if (likely(mp && mp->mp_subscript))
26300 PyObject *py_slice, *py_start, *py_stop;
26302 py_slice = *_py_slice;
26304 PyObject* owned_start = NULL;
26305 PyObject* owned_stop = NULL;
26307 py_start = *_py_start;
26310 owned_start = py_start = PyInt_FromSsize_t(cstart);
26311 if (unlikely(!py_start))
goto bad;
26313 py_start = Py_None;
26316 py_stop = *_py_stop;
26319 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
26320 if (unlikely(!py_stop)) {
26321 Py_XDECREF(owned_start);
26327 py_slice = PySlice_New(py_start, py_stop, Py_None);
26328 Py_XDECREF(owned_start);
26329 Py_XDECREF(owned_stop);
26330 if (unlikely(!py_slice))
goto bad;
26332 #if CYTHON_USE_TYPE_SLOTS
26333 result = mp->mp_subscript(obj, py_slice);
26335 result = PyObject_GetItem(obj, py_slice);
26338 Py_DECREF(py_slice);
26342 PyErr_Format(PyExc_TypeError,
26343 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
26349 #if PY_MAJOR_VERSION < 3
26350 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
26351 CYTHON_UNUSED PyObject *cause) {
26352 __Pyx_PyThreadState_declare
26354 if (!value || value == Py_None)
26358 if (!tb || tb == Py_None)
26362 if (!PyTraceBack_Check(tb)) {
26363 PyErr_SetString(PyExc_TypeError,
26364 "raise: arg 3 must be a traceback or None");
26368 if (PyType_Check(type)) {
26369 #if CYTHON_COMPILING_IN_PYPY
26371 Py_INCREF(Py_None);
26375 PyErr_NormalizeException(&type, &value, &tb);
26378 PyErr_SetString(PyExc_TypeError,
26379 "instance exception may not have a separate value");
26383 type = (PyObject*) Py_TYPE(type);
26385 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26386 PyErr_SetString(PyExc_TypeError,
26387 "raise: exception class must be a subclass of BaseException");
26391 __Pyx_PyThreadState_assign
26392 __Pyx_ErrRestore(type, value, tb);
26401 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26402 PyObject* owned_instance = NULL;
26403 if (tb == Py_None) {
26405 }
else if (tb && !PyTraceBack_Check(tb)) {
26406 PyErr_SetString(PyExc_TypeError,
26407 "raise: arg 3 must be a traceback or None");
26410 if (value == Py_None)
26412 if (PyExceptionInstance_Check(type)) {
26414 PyErr_SetString(PyExc_TypeError,
26415 "instance exception may not have a separate value");
26419 type = (PyObject*) Py_TYPE(value);
26420 }
else if (PyExceptionClass_Check(type)) {
26421 PyObject *instance_class = NULL;
26422 if (value && PyExceptionInstance_Check(value)) {
26423 instance_class = (PyObject*) Py_TYPE(value);
26424 if (instance_class != type) {
26425 int is_subclass = PyObject_IsSubclass(instance_class, type);
26426 if (!is_subclass) {
26427 instance_class = NULL;
26428 }
else if (unlikely(is_subclass == -1)) {
26431 type = instance_class;
26435 if (!instance_class) {
26438 args = PyTuple_New(0);
26439 else if (PyTuple_Check(value)) {
26443 args = PyTuple_Pack(1, value);
26446 owned_instance = PyObject_Call(type, args, NULL);
26448 if (!owned_instance)
26450 value = owned_instance;
26451 if (!PyExceptionInstance_Check(value)) {
26452 PyErr_Format(PyExc_TypeError,
26453 "calling %R should have returned an instance of "
26454 "BaseException, not %R",
26455 type, Py_TYPE(value));
26460 PyErr_SetString(PyExc_TypeError,
26461 "raise: exception class must be a subclass of BaseException");
26465 PyObject *fixed_cause;
26466 if (cause == Py_None) {
26467 fixed_cause = NULL;
26468 }
else if (PyExceptionClass_Check(cause)) {
26469 fixed_cause = PyObject_CallObject(cause, NULL);
26470 if (fixed_cause == NULL)
26472 }
else if (PyExceptionInstance_Check(cause)) {
26473 fixed_cause = cause;
26474 Py_INCREF(fixed_cause);
26476 PyErr_SetString(PyExc_TypeError,
26477 "exception causes must derive from "
26481 PyException_SetCause(value, fixed_cause);
26483 PyErr_SetObject(type, value);
26485 #if CYTHON_COMPILING_IN_PYPY
26486 PyObject *tmp_type, *tmp_value, *tmp_tb;
26487 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26489 PyErr_Restore(tmp_type, tmp_value, tb);
26490 Py_XDECREF(tmp_tb);
26492 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26493 PyObject* tmp_tb = tstate->curexc_traceback;
26494 if (tb != tmp_tb) {
26496 tstate->curexc_traceback = tb;
26497 Py_XDECREF(tmp_tb);
26502 Py_XDECREF(owned_instance);
26508 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
26510 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
26511 PyErr_SetString(PyExc_TypeError,
26512 "hasattr(): attribute name must be string");
26515 r = __Pyx_GetAttr(o,
n);
26516 if (unlikely(!
r)) {
26526 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
26527 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
26529 value = PyDict_GetItemWithError(d, key);
26530 if (unlikely(!value)) {
26531 if (!PyErr_Occurred()) {
26532 if (unlikely(PyTuple_Check(key))) {
26533 PyObject* args = PyTuple_Pack(1, key);
26534 if (likely(args)) {
26535 PyErr_SetObject(PyExc_KeyError, args);
26539 PyErr_SetObject(PyExc_KeyError, key);
26550 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26551 PyErr_Format(PyExc_ValueError,
26552 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
26556 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26557 PyErr_Format(PyExc_ValueError,
26558 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
26559 index, (index == 1) ?
"" :
"s");
26563 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
26564 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
26568 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26569 if (unlikely(!type)) {
26570 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26573 if (likely(__Pyx_TypeCheck(obj, type)))
26575 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
26576 Py_TYPE(obj)->tp_name, type->tp_name);
26581 #if CYTHON_USE_EXC_INFO_STACK
26582 static _PyErr_StackItem *
26583 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26585 _PyErr_StackItem *exc_info = tstate->exc_info;
26586 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26587 exc_info->previous_item != NULL)
26589 exc_info = exc_info->previous_item;
26596 #if CYTHON_FAST_THREAD_STATE
26597 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26598 #if CYTHON_USE_EXC_INFO_STACK
26599 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26600 *type = exc_info->exc_type;
26601 *value = exc_info->exc_value;
26602 *tb = exc_info->exc_traceback;
26604 *type = tstate->exc_type;
26605 *value = tstate->exc_value;
26606 *tb = tstate->exc_traceback;
26609 Py_XINCREF(*value);
26612 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26613 PyObject *tmp_type, *tmp_value, *tmp_tb;
26614 #if CYTHON_USE_EXC_INFO_STACK
26615 _PyErr_StackItem *exc_info = tstate->exc_info;
26616 tmp_type = exc_info->exc_type;
26617 tmp_value = exc_info->exc_value;
26618 tmp_tb = exc_info->exc_traceback;
26619 exc_info->exc_type = type;
26620 exc_info->exc_value = value;
26621 exc_info->exc_traceback = tb;
26623 tmp_type = tstate->exc_type;
26624 tmp_value = tstate->exc_value;
26625 tmp_tb = tstate->exc_traceback;
26626 tstate->exc_type = type;
26627 tstate->exc_value = value;
26628 tstate->exc_traceback = tb;
26630 Py_XDECREF(tmp_type);
26631 Py_XDECREF(tmp_value);
26632 Py_XDECREF(tmp_tb);
26637 #if CYTHON_FAST_THREAD_STATE
26638 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26640 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26643 PyObject *local_type, *local_value, *local_tb;
26644 #if CYTHON_FAST_THREAD_STATE
26645 PyObject *tmp_type, *tmp_value, *tmp_tb;
26646 local_type = tstate->curexc_type;
26647 local_value = tstate->curexc_value;
26648 local_tb = tstate->curexc_traceback;
26649 tstate->curexc_type = 0;
26650 tstate->curexc_value = 0;
26651 tstate->curexc_traceback = 0;
26653 PyErr_Fetch(&local_type, &local_value, &local_tb);
26655 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26656 #if CYTHON_FAST_THREAD_STATE
26657 if (unlikely(tstate->curexc_type))
26659 if (unlikely(PyErr_Occurred()))
26662 #if PY_MAJOR_VERSION >= 3
26664 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26668 Py_XINCREF(local_tb);
26669 Py_XINCREF(local_type);
26670 Py_XINCREF(local_value);
26671 *type = local_type;
26672 *value = local_value;
26674 #if CYTHON_FAST_THREAD_STATE
26675 #if CYTHON_USE_EXC_INFO_STACK
26677 _PyErr_StackItem *exc_info = tstate->exc_info;
26678 tmp_type = exc_info->exc_type;
26679 tmp_value = exc_info->exc_value;
26680 tmp_tb = exc_info->exc_traceback;
26681 exc_info->exc_type = local_type;
26682 exc_info->exc_value = local_value;
26683 exc_info->exc_traceback = local_tb;
26686 tmp_type = tstate->exc_type;
26687 tmp_value = tstate->exc_value;
26688 tmp_tb = tstate->exc_traceback;
26689 tstate->exc_type = local_type;
26690 tstate->exc_value = local_value;
26691 tstate->exc_traceback = local_tb;
26693 Py_XDECREF(tmp_type);
26694 Py_XDECREF(tmp_value);
26695 Py_XDECREF(tmp_tb);
26697 PyErr_SetExcInfo(local_type, local_value, local_tb);
26704 Py_XDECREF(local_type);
26705 Py_XDECREF(local_value);
26706 Py_XDECREF(local_tb);
26711 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
26713 if (unlikely(!type)) {
26714 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26718 #if PY_MAJOR_VERSION == 2
26719 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
26723 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
26725 PyErr_Format(PyExc_TypeError,
26726 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26727 name, type->tp_name, Py_TYPE(obj)->tp_name);
26732 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
26733 #if CYTHON_COMPILING_IN_PYPY
26734 return PyObject_RichCompareBool(s1, s2, equals);
26737 return (equals == Py_EQ);
26738 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26739 const char *ps1, *ps2;
26740 Py_ssize_t length = PyBytes_GET_SIZE(s1);
26741 if (length != PyBytes_GET_SIZE(s2))
26742 return (equals == Py_NE);
26743 ps1 = PyBytes_AS_STRING(s1);
26744 ps2 = PyBytes_AS_STRING(s2);
26745 if (ps1[0] != ps2[0]) {
26746 return (equals == Py_NE);
26747 }
else if (length == 1) {
26748 return (equals == Py_EQ);
26751 #if CYTHON_USE_UNICODE_INTERNALS
26752 Py_hash_t hash1, hash2;
26753 hash1 = ((PyBytesObject*)s1)->ob_shash;
26754 hash2 = ((PyBytesObject*)s2)->ob_shash;
26755 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26756 return (equals == Py_NE);
26759 result = memcmp(ps1, ps2, (
size_t)length);
26760 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26762 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26763 return (equals == Py_NE);
26764 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26765 return (equals == Py_NE);
26768 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26771 result = __Pyx_PyObject_IsTrue(py_result);
26772 Py_DECREF(py_result);
26779 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
26780 #if CYTHON_COMPILING_IN_PYPY
26781 return PyObject_RichCompareBool(s1, s2, equals);
26783 #if PY_MAJOR_VERSION < 3
26784 PyObject* owned_ref = NULL;
26786 int s1_is_unicode, s2_is_unicode;
26790 s1_is_unicode = PyUnicode_CheckExact(s1);
26791 s2_is_unicode = PyUnicode_CheckExact(s2);
26792 #if PY_MAJOR_VERSION < 3
26793 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26794 owned_ref = PyUnicode_FromObject(s2);
26795 if (unlikely(!owned_ref))
26799 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26800 owned_ref = PyUnicode_FromObject(s1);
26801 if (unlikely(!owned_ref))
26805 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26806 return __Pyx_PyBytes_Equals(s1, s2, equals);
26809 if (s1_is_unicode & s2_is_unicode) {
26812 void *data1, *data2;
26813 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26815 length = __Pyx_PyUnicode_GET_LENGTH(s1);
26816 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26819 #if CYTHON_USE_UNICODE_INTERNALS
26821 Py_hash_t hash1, hash2;
26822 #if CYTHON_PEP393_ENABLED
26823 hash1 = ((PyASCIIObject*)s1)->hash;
26824 hash2 = ((PyASCIIObject*)s2)->hash;
26826 hash1 = ((PyUnicodeObject*)s1)->hash;
26827 hash2 = ((PyUnicodeObject*)s2)->hash;
26829 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26834 kind = __Pyx_PyUnicode_KIND(s1);
26835 if (kind != __Pyx_PyUnicode_KIND(s2)) {
26838 data1 = __Pyx_PyUnicode_DATA(s1);
26839 data2 = __Pyx_PyUnicode_DATA(s2);
26840 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26842 }
else if (length == 1) {
26845 int result = memcmp(data1, data2, (
size_t)(length * kind));
26846 #if PY_MAJOR_VERSION < 3
26847 Py_XDECREF(owned_ref);
26849 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26851 }
else if ((s1 == Py_None) & s2_is_unicode) {
26853 }
else if ((s2 == Py_None) & s1_is_unicode) {
26857 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26858 #if PY_MAJOR_VERSION < 3
26859 Py_XDECREF(owned_ref);
26863 result = __Pyx_PyObject_IsTrue(py_result);
26864 Py_DECREF(py_result);
26868 #if PY_MAJOR_VERSION < 3
26869 Py_XDECREF(owned_ref);
26871 return (equals == Py_EQ);
26873 #if PY_MAJOR_VERSION < 3
26874 Py_XDECREF(owned_ref);
26876 return (equals == Py_NE);
26881 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26882 Py_ssize_t
q = a / b;
26883 Py_ssize_t
r = a -
q*b;
26884 q -= ((
r != 0) & ((
r ^ b) < 0));
26889 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26890 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26891 const char* encoding,
const char* errors,
26892 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
26894 if (unlikely((start < 0) | (stop < 0))) {
26895 size_t slen = strlen(cstring);
26896 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
26897 PyErr_SetString(PyExc_OverflowError,
26898 "c-string too long to convert to Python");
26901 length = (Py_ssize_t) slen;
26910 if (unlikely(stop <= start))
26911 return __Pyx_NewRef(__pyx_empty_unicode);
26912 length = stop - start;
26915 return decode_func(cstring, length, errors);
26917 return PyUnicode_Decode(cstring, length, encoding, errors);
26922 #if CYTHON_FAST_THREAD_STATE
26923 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26924 PyObject *tmp_type, *tmp_value, *tmp_tb;
26925 #if CYTHON_USE_EXC_INFO_STACK
26926 _PyErr_StackItem *exc_info = tstate->exc_info;
26927 tmp_type = exc_info->exc_type;
26928 tmp_value = exc_info->exc_value;
26929 tmp_tb = exc_info->exc_traceback;
26930 exc_info->exc_type = *type;
26931 exc_info->exc_value = *value;
26932 exc_info->exc_traceback = *tb;
26934 tmp_type = tstate->exc_type;
26935 tmp_value = tstate->exc_value;
26936 tmp_tb = tstate->exc_traceback;
26937 tstate->exc_type = *type;
26938 tstate->exc_value = *value;
26939 tstate->exc_traceback = *tb;
26942 *value = tmp_value;
26946 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26947 PyObject *tmp_type, *tmp_value, *tmp_tb;
26948 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26949 PyErr_SetExcInfo(*type, *value, *tb);
26951 *value = tmp_value;
26957 #if CYTHON_COMPILING_IN_CPYTHON
26958 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26964 return b == &PyBaseObject_Type;
26966 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26968 if (a == b)
return 1;
26972 n = PyTuple_GET_SIZE(mro);
26973 for (i = 0; i <
n; i++) {
26974 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26979 return __Pyx_InBases(a, b);
26981 #if PY_MAJOR_VERSION == 2
26982 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26983 PyObject *exception, *value, *tb;
26985 __Pyx_PyThreadState_declare
26986 __Pyx_PyThreadState_assign
26987 __Pyx_ErrFetch(&exception, &value, &tb);
26988 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26989 if (unlikely(res == -1)) {
26990 PyErr_WriteUnraisable(err);
26994 res = PyObject_IsSubclass(err, exc_type2);
26995 if (unlikely(res == -1)) {
26996 PyErr_WriteUnraisable(err);
27000 __Pyx_ErrRestore(exception, value, tb);
27004 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
27005 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
27007 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
27012 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27014 assert(PyExceptionClass_Check(exc_type));
27015 n = PyTuple_GET_SIZE(tuple);
27016 #if PY_MAJOR_VERSION >= 3
27017 for (i=0; i<
n; i++) {
27018 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
27021 for (i=0; i<
n; i++) {
27022 PyObject *t = PyTuple_GET_ITEM(tuple, i);
27023 #if PY_MAJOR_VERSION < 3
27024 if (likely(exc_type == t))
return 1;
27026 if (likely(PyExceptionClass_Check(t))) {
27027 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
27033 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
27034 if (likely(err == exc_type))
return 1;
27035 if (likely(PyExceptionClass_Check(err))) {
27036 if (likely(PyExceptionClass_Check(exc_type))) {
27037 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
27038 }
else if (likely(PyTuple_Check(exc_type))) {
27039 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
27043 return PyErr_GivenExceptionMatches(err, exc_type);
27045 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
27046 assert(PyExceptionClass_Check(exc_type1));
27047 assert(PyExceptionClass_Check(exc_type2));
27048 if (likely(err == exc_type1 || err == exc_type2))
return 1;
27049 if (likely(PyExceptionClass_Check(err))) {
27050 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
27052 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
27057 #if !CYTHON_COMPILING_IN_PYPY
27058 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
27060 (void)zerodivision_check;
27061 #if PY_MAJOR_VERSION < 3
27062 if (likely(PyInt_CheckExact(op1))) {
27063 const long b = intval;
27065 long a = PyInt_AS_LONG(op1);
27066 x = (long)((
unsigned long)a + b);
27067 if (likely((x^a) >= 0 || (x^b) >= 0))
27068 return PyInt_FromLong(x);
27069 return PyLong_Type.tp_as_number->nb_add(op1, op2);
27072 #if CYTHON_USE_PYLONG_INTERNALS
27073 if (likely(PyLong_CheckExact(op1))) {
27074 const long b = intval;
27076 #ifdef HAVE_LONG_LONG
27077 const PY_LONG_LONG llb = intval;
27078 PY_LONG_LONG lla, llx;
27080 const digit* digits = ((PyLongObject*)op1)->ob_digit;
27081 const Py_ssize_t size = Py_SIZE(op1);
27082 if (likely(__Pyx_sst_abs(size) <= 1)) {
27083 a = likely(size) ? digits[0] : 0;
27084 if (size == -1) a = -a;
27088 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27089 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27091 #ifdef HAVE_LONG_LONG
27092 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27093 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27097 CYTHON_FALLTHROUGH;
27099 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27100 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27102 #ifdef HAVE_LONG_LONG
27103 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27104 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27108 CYTHON_FALLTHROUGH;
27110 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27111 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27113 #ifdef HAVE_LONG_LONG
27114 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27115 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27119 CYTHON_FALLTHROUGH;
27121 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27122 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27124 #ifdef HAVE_LONG_LONG
27125 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27126 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27130 CYTHON_FALLTHROUGH;
27132 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27133 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27135 #ifdef HAVE_LONG_LONG
27136 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27137 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27141 CYTHON_FALLTHROUGH;
27143 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27144 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27146 #ifdef HAVE_LONG_LONG
27147 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27148 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27152 CYTHON_FALLTHROUGH;
27153 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
27157 return PyLong_FromLong(x);
27158 #ifdef HAVE_LONG_LONG
27161 return PyLong_FromLongLong(llx);
27167 if (PyFloat_CheckExact(op1)) {
27168 const long b = intval;
27169 double a = PyFloat_AS_DOUBLE(op1);
27171 PyFPE_START_PROTECT(
"add",
return NULL)
27172 result = ((double)a) + (double)b;
27173 PyFPE_END_PROTECT(result)
27174 return PyFloat_FromDouble(result);
27176 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
27181 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
27182 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
27186 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
27189 q -= ((
r != 0) & ((
r ^ b) < 0));
27194 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27195 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
27196 PyErr_Format(PyExc_AttributeError,
27197 #
if PY_MAJOR_VERSION >= 3
27198 "'%.50s' object has no attribute '%U'",
27199 tp->tp_name, attr_name);
27201 "'%.50s' object has no attribute '%.400s'",
27202 tp->tp_name, PyString_AS_STRING(attr_name));
27206 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
27208 PyTypeObject *tp = Py_TYPE(obj);
27209 if (unlikely(!PyString_Check(attr_name))) {
27210 return PyObject_GenericGetAttr(obj, attr_name);
27212 assert(!tp->tp_dictoffset);
27213 descr = _PyType_Lookup(tp, attr_name);
27214 if (unlikely(!descr)) {
27215 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
27218 #if PY_MAJOR_VERSION < 3
27219 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
27222 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
27224 PyObject *res =
f(descr, obj, (PyObject *)tp);
27234 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27235 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
27236 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
27237 return PyObject_GenericGetAttr(obj, attr_name);
27239 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
27244 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
27245 __Pyx_PyThreadState_declare
27246 __Pyx_PyThreadState_assign
27247 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
27248 __Pyx_PyErr_Clear();
27250 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
27252 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
27253 PyTypeObject* tp = Py_TYPE(obj);
27254 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
27255 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
27258 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
27259 if (unlikely(!result)) {
27260 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
27266 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
27268 PyObject *name_attr;
27269 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
27270 if (likely(name_attr)) {
27271 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
27275 if (unlikely(ret < 0)) {
27279 Py_XDECREF(name_attr);
27282 static int __Pyx_setup_reduce(PyObject* type_obj) {
27284 PyObject *object_reduce = NULL;
27285 PyObject *object_reduce_ex = NULL;
27286 PyObject *reduce = NULL;
27287 PyObject *reduce_ex = NULL;
27288 PyObject *reduce_cython = NULL;
27289 PyObject *setstate = NULL;
27290 PyObject *setstate_cython = NULL;
27291 #if CYTHON_USE_PYTYPE_LOOKUP
27292 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
27294 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
27296 #if CYTHON_USE_PYTYPE_LOOKUP
27297 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
27299 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
27301 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
27302 if (reduce_ex == object_reduce_ex) {
27303 #if CYTHON_USE_PYTYPE_LOOKUP
27304 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
27306 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
27308 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
27309 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
27310 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
27311 if (likely(reduce_cython)) {
27312 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
27313 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
27314 }
else if (reduce == object_reduce || PyErr_Occurred()) {
27317 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
27318 if (!setstate) PyErr_Clear();
27319 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
27320 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
27321 if (likely(setstate_cython)) {
27322 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
27323 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
27324 }
else if (!setstate || PyErr_Occurred()) {
27328 PyType_Modified((PyTypeObject*)type_obj);
27333 if (!PyErr_Occurred())
27334 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
27337 #if !CYTHON_USE_PYTYPE_LOOKUP
27338 Py_XDECREF(object_reduce);
27339 Py_XDECREF(object_reduce_ex);
27341 Py_XDECREF(reduce);
27342 Py_XDECREF(reduce_ex);
27343 Py_XDECREF(reduce_cython);
27344 Py_XDECREF(setstate);
27345 Py_XDECREF(setstate_cython);
27350 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
27351 #if PY_VERSION_HEX >= 0x02070000
27352 PyObject *ob = PyCapsule_New(vtable, 0, 0);
27354 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
27358 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
27368 #ifndef __PYX_HAVE_RT_ImportType
27369 #define __PYX_HAVE_RT_ImportType
27370 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
27371 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
27373 PyObject *result = 0;
27375 Py_ssize_t basicsize;
27376 #ifdef Py_LIMITED_API
27377 PyObject *py_basicsize;
27379 result = PyObject_GetAttrString(module, class_name);
27382 if (!PyType_Check(result)) {
27383 PyErr_Format(PyExc_TypeError,
27384 "%.200s.%.200s is not a type object",
27385 module_name, class_name);
27388 #ifndef Py_LIMITED_API
27389 basicsize = ((PyTypeObject *)result)->tp_basicsize;
27391 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
27394 basicsize = PyLong_AsSsize_t(py_basicsize);
27395 Py_DECREF(py_basicsize);
27397 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27400 if ((
size_t)basicsize < size) {
27401 PyErr_Format(PyExc_ValueError,
27402 "%.200s.%.200s size changed, may indicate binary incompatibility. "
27403 "Expected %zd from C header, got %zd from PyObject",
27404 module_name, class_name, size, basicsize);
27407 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
27408 PyErr_Format(PyExc_ValueError,
27409 "%.200s.%.200s size changed, may indicate binary incompatibility. "
27410 "Expected %zd from C header, got %zd from PyObject",
27411 module_name, class_name, size, basicsize);
27414 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
27415 PyOS_snprintf(warning,
sizeof(warning),
27416 "%s.%s size changed, may indicate binary incompatibility. "
27417 "Expected %zd from C header, got %zd from PyObject",
27418 module_name, class_name, size, basicsize);
27419 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
27421 return (PyTypeObject *)result;
27423 Py_XDECREF(result);
27429 #ifndef CYTHON_CLINE_IN_TRACEBACK
27430 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
27431 PyObject *use_cline;
27432 PyObject *ptype, *pvalue, *ptraceback;
27433 #if CYTHON_COMPILING_IN_CPYTHON
27434 PyObject **cython_runtime_dict;
27436 if (unlikely(!__pyx_cython_runtime)) {
27439 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27440 #if CYTHON_COMPILING_IN_CPYTHON
27441 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27442 if (likely(cython_runtime_dict)) {
27443 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27444 use_cline, *cython_runtime_dict,
27445 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27449 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27450 if (use_cline_obj) {
27451 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27452 Py_DECREF(use_cline_obj);
27460 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27462 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27465 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27471 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
27472 int start = 0, mid = 0, end = count - 1;
27473 if (end >= 0 && code_line > entries[end].code_line) {
27476 while (start < end) {
27477 mid = start + (end - start) / 2;
27478 if (code_line < entries[mid].code_line) {
27480 }
else if (code_line > entries[mid].code_line) {
27486 if (code_line <= entries[mid].code_line) {
27492 static PyCodeObject *__pyx_find_code_object(
int code_line) {
27493 PyCodeObject* code_object;
27495 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27498 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27499 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
27502 code_object = __pyx_code_cache.entries[
pos].code_object;
27503 Py_INCREF(code_object);
27504 return code_object;
27506 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27508 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27509 if (unlikely(!code_line)) {
27512 if (unlikely(!entries)) {
27513 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27514 if (likely(entries)) {
27515 __pyx_code_cache.entries = entries;
27516 __pyx_code_cache.max_count = 64;
27517 __pyx_code_cache.count = 1;
27518 entries[0].code_line = code_line;
27519 entries[0].code_object = code_object;
27520 Py_INCREF(code_object);
27524 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27525 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
27526 PyCodeObject* tmp = entries[
pos].code_object;
27527 entries[
pos].code_object = code_object;
27531 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27532 int new_max = __pyx_code_cache.max_count + 64;
27533 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27534 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
27535 if (unlikely(!entries)) {
27538 __pyx_code_cache.entries = entries;
27539 __pyx_code_cache.max_count = new_max;
27541 for (i=__pyx_code_cache.count; i>
pos; i--) {
27542 entries[i] = entries[i-1];
27544 entries[
pos].code_line = code_line;
27545 entries[
pos].code_object = code_object;
27546 __pyx_code_cache.count++;
27547 Py_INCREF(code_object);
27551 #include "compile.h"
27552 #include "frameobject.h"
27553 #include "traceback.h"
27554 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27555 const char *funcname,
int c_line,
27556 int py_line,
const char *filename) {
27557 PyCodeObject *py_code = 0;
27558 PyObject *py_srcfile = 0;
27559 PyObject *py_funcname = 0;
27560 #if PY_MAJOR_VERSION < 3
27561 py_srcfile = PyString_FromString(filename);
27563 py_srcfile = PyUnicode_FromString(filename);
27565 if (!py_srcfile)
goto bad;
27567 #if PY_MAJOR_VERSION < 3
27568 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27570 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27574 #if PY_MAJOR_VERSION < 3
27575 py_funcname = PyString_FromString(funcname);
27577 py_funcname = PyUnicode_FromString(funcname);
27580 if (!py_funcname)
goto bad;
27581 py_code = __Pyx_PyCode_New(
27598 Py_DECREF(py_srcfile);
27599 Py_DECREF(py_funcname);
27602 Py_XDECREF(py_srcfile);
27603 Py_XDECREF(py_funcname);
27606 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27607 int py_line,
const char *filename) {
27608 PyCodeObject *py_code = 0;
27609 PyFrameObject *py_frame = 0;
27610 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27612 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27614 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27616 py_code = __Pyx_CreateCodeObjectForTraceback(
27617 funcname, c_line, py_line, filename);
27618 if (!py_code)
goto bad;
27619 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27621 py_frame = PyFrame_New(
27627 if (!py_frame)
goto bad;
27628 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27629 PyTraceBack_Here(py_frame);
27631 Py_XDECREF(py_code);
27632 Py_XDECREF(py_frame);
27635 #if PY_MAJOR_VERSION < 3
27636 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27637 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27638 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27639 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27640 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27643 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27644 PyObject *obj = view->obj;
27646 if (PyObject_CheckBuffer(obj)) {
27647 PyBuffer_Release(view);
27659 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27661 int i, index, step, start;
27662 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27663 if (order ==
'F') {
27670 for (i = 0; i < ndim; i++) {
27671 index = start + step * i;
27672 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27674 itemsize *= mvs.shape[index];
27681 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27682 void **out_start,
void **out_end,
27683 int ndim,
size_t itemsize)
27687 start = end = slice->data;
27688 for (i = 0; i < ndim; i++) {
27689 Py_ssize_t stride = slice->strides[i];
27690 Py_ssize_t extent = slice->shape[i];
27692 *out_start = *out_end = start;
27696 end += stride * (extent - 1);
27698 start += stride * (extent - 1);
27701 *out_start = start;
27702 *out_end = end + itemsize;
27705 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27706 __Pyx_memviewslice *slice2,
27707 int ndim,
size_t itemsize)
27709 void *start1, *end1, *start2, *end2;
27710 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27711 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27712 return (start1 < end2) && (start2 < end1);
27716 static CYTHON_INLINE PyObject *
27717 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27720 #if PY_VERSION_HEX >= 0x02070000
27721 cobj = PyCapsule_New(p, sig, NULL);
27723 cobj = PyCObject_FromVoidPtr(p, NULL);
27729 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
27730 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
27732 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
27733 double value = __pyx_PyFloat_AsDouble(obj);
27734 if ((value == (
double)-1) && PyErr_Occurred())
27736 *(
double *) itemp = value;
27741 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
27747 S.u32 = 0x01020304;
27748 return S.u8[0] == 4;
27752 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27753 __Pyx_BufFmt_StackElem* stack,
27754 __Pyx_TypeInfo* type) {
27755 stack[0].field = &ctx->root;
27756 stack[0].parent_offset = 0;
27757 ctx->root.type = type;
27758 ctx->root.name =
"buffer dtype";
27759 ctx->root.offset = 0;
27761 ctx->head->field = &ctx->root;
27762 ctx->fmt_offset = 0;
27763 ctx->head->parent_offset = 0;
27764 ctx->new_packmode =
'@';
27765 ctx->enc_packmode =
'@';
27766 ctx->new_count = 1;
27767 ctx->enc_count = 0;
27769 ctx->is_complex = 0;
27770 ctx->is_valid_array = 0;
27771 ctx->struct_alignment = 0;
27772 while (type->typegroup ==
'S') {
27774 ctx->head->field = type->fields;
27775 ctx->head->parent_offset = 0;
27776 type = type->fields->type;
27779 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
27781 const char* t = *ts;
27782 if (*t < '0' || *t >
'9') {
27785 count = *t++ -
'0';
27786 while (*t >=
'0' && *t <=
'9') {
27788 count += *t++ -
'0';
27794 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
27795 int number = __Pyx_BufFmt_ParseNumber(ts);
27797 PyErr_Format(PyExc_ValueError,\
27798 "Does not understand character buffer dtype format string ('%c')", **ts);
27801 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
27802 PyErr_Format(PyExc_ValueError,
27803 "Unexpected format string character: '%c'", ch);
27805 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
27807 case '?':
return "'bool'";
27808 case 'c':
return "'char'";
27809 case 'b':
return "'signed char'";
27810 case 'B':
return "'unsigned char'";
27811 case 'h':
return "'short'";
27812 case 'H':
return "'unsigned short'";
27813 case 'i':
return "'int'";
27814 case 'I':
return "'unsigned int'";
27815 case 'l':
return "'long'";
27816 case 'L':
return "'unsigned long'";
27817 case 'q':
return "'long long'";
27818 case 'Q':
return "'unsigned long long'";
27819 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
27820 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
27821 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
27822 case 'T':
return "a struct";
27823 case 'O':
return "Python object";
27824 case 'P':
return "a pointer";
27825 case 's':
case 'p':
return "a string";
27826 case 0:
return "end";
27827 default:
return "unparseable format string";
27830 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
27832 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27833 case 'h':
case 'H':
return 2;
27834 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
27835 case 'q':
case 'Q':
return 8;
27836 case 'f':
return (is_complex ? 8 : 4);
27837 case 'd':
return (is_complex ? 16 : 8);
27839 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
27842 case 'O':
case 'P':
return sizeof(
void*);
27844 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27848 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
27850 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27851 case 'h':
case 'H':
return sizeof(short);
27852 case 'i':
case 'I':
return sizeof(int);
27853 case 'l':
case 'L':
return sizeof(long);
27854 #ifdef HAVE_LONG_LONG
27855 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
27857 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
27858 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
27859 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
27860 case 'O':
case 'P':
return sizeof(
void*);
27862 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27867 typedef struct {
char c;
short x; } __Pyx_st_short;
27868 typedef struct {
char c;
int x; } __Pyx_st_int;
27869 typedef struct {
char c;
long x; } __Pyx_st_long;
27870 typedef struct {
char c;
float x; } __Pyx_st_float;
27871 typedef struct {
char c;
double x; } __Pyx_st_double;
27872 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
27873 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
27874 #ifdef HAVE_LONG_LONG
27875 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27877 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
27879 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27880 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
27881 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
27882 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
27883 #ifdef HAVE_LONG_LONG
27884 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
27886 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
27887 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
27888 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
27889 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
27891 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27899 typedef struct {
short x;
char c; } __Pyx_pad_short;
27900 typedef struct {
int x;
char c; } __Pyx_pad_int;
27901 typedef struct {
long x;
char c; } __Pyx_pad_long;
27902 typedef struct {
float x;
char c; } __Pyx_pad_float;
27903 typedef struct {
double x;
char c; } __Pyx_pad_double;
27904 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
27905 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
27906 #ifdef HAVE_LONG_LONG
27907 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
27909 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
27911 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27912 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
27913 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
27914 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
27915 #ifdef HAVE_LONG_LONG
27916 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
27918 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
27919 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
27920 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
27921 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
27923 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27927 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
27931 case 'b':
case 'h':
case 'i':
27932 case 'l':
case 'q':
case 's':
case 'p':
27934 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
27936 case 'f':
case 'd':
case 'g':
27937 return (is_complex ?
'C' :
'R');
27943 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27948 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27949 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27950 const char* expected;
27952 if (ctx->head == NULL) {
27956 expected = ctx->head->field->type->name;
27959 PyErr_Format(PyExc_ValueError,
27960 "Buffer dtype mismatch, expected %s%s%s but got %s",
27961 quote, expected, quote,
27962 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27964 __Pyx_StructField* field = ctx->head->field;
27965 __Pyx_StructField* parent = (ctx->head - 1)->field;
27966 PyErr_Format(PyExc_ValueError,
27967 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27968 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27969 parent->type->name, field->name);
27972 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27974 size_t size, offset, arraysize = 1;
27975 if (ctx->enc_type == 0)
return 0;
27976 if (ctx->head->field->type->arraysize[0]) {
27978 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27979 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27981 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27982 PyErr_Format(PyExc_ValueError,
27983 "Expected a dimension of size %zu, got %zu",
27984 ctx->head->field->type->arraysize[0], ctx->enc_count);
27988 if (!ctx->is_valid_array) {
27989 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27990 ctx->head->field->type->ndim, ndim);
27993 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27994 arraysize *= ctx->head->field->type->arraysize[i];
27996 ctx->is_valid_array = 0;
27997 ctx->enc_count = 1;
27999 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28001 __Pyx_StructField* field = ctx->head->field;
28002 __Pyx_TypeInfo* type = field->type;
28003 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
28004 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28006 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28008 if (ctx->enc_packmode ==
'@') {
28009 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28010 size_t align_mod_offset;
28011 if (align_at == 0)
return -1;
28012 align_mod_offset = ctx->fmt_offset % align_at;
28013 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28014 if (ctx->struct_alignment == 0)
28015 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28018 if (type->size != size || type->typegroup != group) {
28019 if (type->typegroup ==
'C' && type->fields != NULL) {
28020 size_t parent_offset = ctx->head->parent_offset + field->offset;
28022 ctx->head->field = type->fields;
28023 ctx->head->parent_offset = parent_offset;
28026 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
28028 __Pyx_BufFmt_RaiseExpected(ctx);
28032 offset = ctx->head->parent_offset + field->offset;
28033 if (ctx->fmt_offset != offset) {
28034 PyErr_Format(PyExc_ValueError,
28035 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
28036 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28039 ctx->fmt_offset += size;
28041 ctx->fmt_offset += (arraysize - 1) * size;
28044 if (field == &ctx->root) {
28046 if (ctx->enc_count != 0) {
28047 __Pyx_BufFmt_RaiseExpected(ctx);
28052 ctx->head->field = ++field;
28053 if (field->type == NULL) {
28055 field = ctx->head->field;
28057 }
else if (field->type->typegroup ==
'S') {
28058 size_t parent_offset = ctx->head->parent_offset + field->offset;
28059 if (field->type->fields->type == NULL)
continue;
28060 field = field->type->fields;
28062 ctx->head->field = field;
28063 ctx->head->parent_offset = parent_offset;
28069 }
while (ctx->enc_count);
28071 ctx->is_complex = 0;
28075 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
28077 const char *ts = *tsp;
28078 int i = 0,
number, ndim;
28080 if (ctx->new_count != 1) {
28081 PyErr_SetString(PyExc_ValueError,
28082 "Cannot handle repeated arrays in format string");
28085 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28086 ndim = ctx->head->field->type->ndim;
28087 while (*ts && *ts !=
')') {
28089 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
28092 number = __Pyx_BufFmt_ExpectNumber(&ts);
28093 if (
number == -1)
return NULL;
28094 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
28095 return PyErr_Format(PyExc_ValueError,
28096 "Expected a dimension of size %zu, got %d",
28097 ctx->head->field->type->arraysize[i],
number);
28098 if (*ts !=
',' && *ts !=
')')
28099 return PyErr_Format(PyExc_ValueError,
28100 "Expected a comma in format string, got '%c'", *ts);
28101 if (*ts ==
',') ts++;
28105 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
28106 ctx->head->field->type->ndim, i);
28108 PyErr_SetString(PyExc_ValueError,
28109 "Unexpected end of format string, expected ')'");
28112 ctx->is_valid_array = 1;
28113 ctx->new_count = 1;
28117 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
28122 if (ctx->enc_type != 0 && ctx->head == NULL) {
28123 __Pyx_BufFmt_RaiseExpected(ctx);
28126 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28127 if (ctx->head != NULL) {
28128 __Pyx_BufFmt_RaiseExpected(ctx);
28138 if (!__Pyx_Is_Little_Endian()) {
28139 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
28142 ctx->new_packmode =
'=';
28147 if (__Pyx_Is_Little_Endian()) {
28148 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
28151 ctx->new_packmode =
'=';
28157 ctx->new_packmode = *ts++;
28161 const char* ts_after_sub;
28162 size_t i, struct_count = ctx->new_count;
28163 size_t struct_alignment = ctx->struct_alignment;
28164 ctx->new_count = 1;
28167 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
28170 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28172 ctx->enc_count = 0;
28173 ctx->struct_alignment = 0;
28176 for (i = 0; i != struct_count; ++i) {
28177 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28178 if (!ts_after_sub)
return NULL;
28181 if (struct_alignment) ctx->struct_alignment = struct_alignment;
28186 size_t alignment = ctx->struct_alignment;
28188 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28190 if (alignment && ctx->fmt_offset % alignment) {
28191 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28196 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28197 ctx->fmt_offset += ctx->new_count;
28198 ctx->new_count = 1;
28199 ctx->enc_count = 0;
28201 ctx->enc_packmode = ctx->new_packmode;
28207 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
28208 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
28211 CYTHON_FALLTHROUGH;
28212 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
28213 case 'l':
case 'L':
case 'q':
case 'Q':
28214 case 'f':
case 'd':
case 'g':
28215 case 'O':
case 'p':
28216 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
28217 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
28218 ctx->enc_count += ctx->new_count;
28219 ctx->new_count = 1;
28224 CYTHON_FALLTHROUGH;
28226 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28227 ctx->enc_count = ctx->new_count;
28228 ctx->enc_packmode = ctx->new_packmode;
28229 ctx->enc_type = *ts;
28230 ctx->is_complex = got_Z;
28232 ctx->new_count = 1;
28237 while(*ts !=
':') ++ts;
28241 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
28245 int number = __Pyx_BufFmt_ExpectNumber(&ts);
28246 if (
number == -1)
return NULL;
28247 ctx->new_count = (size_t)
number;
28255 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
28262 if (a->size != b->size || a->typegroup != b->typegroup ||
28263 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
28264 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
28265 return a->size == b->size;
28271 for (i = 0; i < a->ndim; i++)
28272 if (a->arraysize[i] != b->arraysize[i])
28275 if (a->typegroup ==
'S') {
28276 if (a->flags != b->flags)
28278 if (a->fields || b->fields) {
28279 if (!(a->fields && b->fields))
28281 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
28282 __Pyx_StructField *field_a = a->fields + i;
28283 __Pyx_StructField *field_b = b->fields + i;
28284 if (field_a->offset != field_b->offset ||
28285 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
28288 return !a->fields[i].type && !b->fields[i].type;
28296 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
28298 if (buf->shape[dim] <= 1)
28300 if (buf->strides) {
28301 if (spec & __Pyx_MEMVIEW_CONTIG) {
28302 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
28303 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
28304 PyErr_Format(PyExc_ValueError,
28305 "Buffer is not indirectly contiguous "
28306 "in dimension %d.", dim);
28309 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
28310 PyErr_SetString(PyExc_ValueError,
28311 "Buffer and memoryview are not contiguous "
28312 "in the same dimension.");
28316 if (spec & __Pyx_MEMVIEW_FOLLOW) {
28317 Py_ssize_t stride = buf->strides[dim];
28320 if (unlikely(stride < buf->itemsize)) {
28321 PyErr_SetString(PyExc_ValueError,
28322 "Buffer and memoryview are not contiguous "
28323 "in the same dimension.");
28328 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
28329 PyErr_Format(PyExc_ValueError,
28330 "C-contiguous buffer is not contiguous in "
28331 "dimension %d", dim);
28333 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
28334 PyErr_Format(PyExc_ValueError,
28335 "C-contiguous buffer is not indirect in "
28336 "dimension %d", dim);
28338 }
else if (unlikely(buf->suboffsets)) {
28339 PyErr_SetString(PyExc_ValueError,
28340 "Buffer exposes suboffsets but no strides");
28349 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
28351 if (spec & __Pyx_MEMVIEW_DIRECT) {
28352 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
28353 PyErr_Format(PyExc_ValueError,
28354 "Buffer not compatible with direct access "
28355 "in dimension %d.", dim);
28359 if (spec & __Pyx_MEMVIEW_PTR) {
28360 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
28361 PyErr_Format(PyExc_ValueError,
28362 "Buffer is not indirectly accessible "
28363 "in dimension %d.", dim);
28372 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
28375 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28376 Py_ssize_t stride = 1;
28377 for (i = 0; i < ndim; i++) {
28378 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28379 PyErr_SetString(PyExc_ValueError,
28380 "Buffer not fortran contiguous.");
28383 stride = stride * buf->shape[i];
28385 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28386 Py_ssize_t stride = 1;
28387 for (i = ndim - 1; i >- 1; i--) {
28388 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28389 PyErr_SetString(PyExc_ValueError,
28390 "Buffer not C contiguous.");
28393 stride = stride * buf->shape[i];
28400 static int __Pyx_ValidateAndInit_memviewslice(
28405 __Pyx_TypeInfo *dtype,
28406 __Pyx_BufFmt_StackElem stack[],
28407 __Pyx_memviewslice *memviewslice,
28408 PyObject *original_obj)
28410 struct __pyx_memoryview_obj *memview, *new_memview;
28411 __Pyx_RefNannyDeclarations
28413 int i, spec = 0, retval = -1;
28414 __Pyx_BufFmt_Context ctx;
28415 int from_memoryview = __pyx_memoryview_check(original_obj);
28416 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
28417 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
28418 original_obj)->typeinfo)) {
28419 memview = (
struct __pyx_memoryview_obj *) original_obj;
28420 new_memview = NULL;
28422 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28423 original_obj, buf_flags, 0, dtype);
28424 new_memview = memview;
28425 if (unlikely(!memview))
28428 buf = &memview->view;
28429 if (unlikely(buf->ndim != ndim)) {
28430 PyErr_Format(PyExc_ValueError,
28431 "Buffer has wrong number of dimensions (expected %d, got %d)",
28436 __Pyx_BufFmt_Init(&ctx, stack, dtype);
28437 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
28439 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
28440 PyErr_Format(PyExc_ValueError,
28441 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
28442 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
28444 (buf->itemsize > 1) ?
"s" :
"",
28447 (dtype->size > 1) ?
"s" :
"");
28450 if (buf->len > 0) {
28451 for (i = 0; i < ndim; i++) {
28452 spec = axes_specs[i];
28453 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
28455 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
28458 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
28461 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28462 new_memview != NULL) == -1)) {
28468 Py_XDECREF(new_memview);
28471 __Pyx_RefNannyFinishContext();
28476 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
28477 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28478 __Pyx_BufFmt_StackElem stack[1];
28479 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28481 if (obj == Py_None) {
28482 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28485 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28486 PyBUF_RECORDS_RO | writable_flag, 1,
28487 &__Pyx_TypeInfo_double, stack,
28489 if (unlikely(retcode == -1))
28493 result.memview = NULL;
28494 result.data = NULL;
28499 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28500 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
28501 const int is_unsigned = neg_one > const_zero;
28503 if (
sizeof(
int) <
sizeof(long)) {
28504 return PyInt_FromLong((
long) value);
28505 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28506 return PyLong_FromUnsignedLong((
unsigned long) value);
28507 #ifdef HAVE_LONG_LONG
28508 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28509 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28513 if (
sizeof(
int) <=
sizeof(
long)) {
28514 return PyInt_FromLong((
long) value);
28515 #ifdef HAVE_LONG_LONG
28516 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28517 return PyLong_FromLongLong((PY_LONG_LONG) value);
28522 int one = 1;
int little = (int)*(
unsigned char *)&one;
28523 unsigned char *bytes = (
unsigned char *)&value;
28524 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28525 little, !is_unsigned);
28530 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28531 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28532 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28533 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28534 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28536 func_type value = func_value;\
28537 if (sizeof(target_type) < sizeof(func_type)) {\
28538 if (unlikely(value != (func_type) (target_type) value)) {\
28539 func_type zero = 0;\
28540 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28541 return (target_type) -1;\
28542 if (is_unsigned && unlikely(value < zero))\
28543 goto raise_neg_overflow;\
28545 goto raise_overflow;\
28548 return (target_type) value;\
28552 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28553 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
28554 const int is_unsigned = neg_one > const_zero;
28556 if (
sizeof(
long) <
sizeof(long)) {
28557 return PyInt_FromLong((
long) value);
28558 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28559 return PyLong_FromUnsignedLong((
unsigned long) value);
28560 #ifdef HAVE_LONG_LONG
28561 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28562 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28566 if (
sizeof(
long) <=
sizeof(
long)) {
28567 return PyInt_FromLong((
long) value);
28568 #ifdef HAVE_LONG_LONG
28569 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28570 return PyLong_FromLongLong((PY_LONG_LONG) value);
28575 int one = 1;
int little = (int)*(
unsigned char *)&one;
28576 unsigned char *bytes = (
unsigned char *)&value;
28577 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28578 little, !is_unsigned);
28583 #if CYTHON_CCOMPLEX
28585 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28586 return ::std::complex< float >(x, y);
28589 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28590 return x + y*(__pyx_t_float_complex)_Complex_I;
28594 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28595 __pyx_t_float_complex
z;
28603 #if CYTHON_CCOMPLEX
28605 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28606 return (a.real == b.real) && (a.imag == b.imag);
28608 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28609 __pyx_t_float_complex
z;
28610 z.real = a.real + b.real;
28611 z.imag = a.imag + b.imag;
28614 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28615 __pyx_t_float_complex
z;
28616 z.real = a.real - b.real;
28617 z.imag = a.imag - b.imag;
28620 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28621 __pyx_t_float_complex
z;
28622 z.real = a.real * b.real - a.imag * b.imag;
28623 z.imag = a.real * b.imag + a.imag * b.real;
28627 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28629 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28630 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
28631 if (b.real == 0 && b.imag == 0) {
28632 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28634 float r = b.imag / b.real;
28635 float s = (float)(1.0) / (b.real + b.imag *
r);
28636 return __pyx_t_float_complex_from_parts(
28637 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28640 float r = b.real / b.imag;
28641 float s = (float)(1.0) / (b.imag + b.real *
r);
28642 return __pyx_t_float_complex_from_parts(
28643 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28647 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28649 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28651 float denom = b.real * b.real + b.imag * b.imag;
28652 return __pyx_t_float_complex_from_parts(
28653 (a.real * b.real + a.imag * b.imag) / denom,
28654 (a.imag * b.real - a.real * b.imag) / denom);
28658 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28659 __pyx_t_float_complex
z;
28664 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28665 return (a.real == 0) && (a.imag == 0);
28667 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28668 __pyx_t_float_complex
z;
28674 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
28675 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28676 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
28678 return hypotf(
z.real,
z.imag);
28681 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28682 __pyx_t_float_complex
z;
28683 float r, lnr, theta, z_r, z_theta;
28684 if (b.imag == 0 && b.real == (
int)b.real) {
28686 float denom = a.real * a.real + a.imag * a.imag;
28687 a.real = a.real / denom;
28688 a.imag = -a.imag / denom;
28691 switch ((
int)b.real) {
28699 return __Pyx_c_prod_float(a, a);
28701 z = __Pyx_c_prod_float(a, a);
28702 return __Pyx_c_prod_float(
z, a);
28704 z = __Pyx_c_prod_float(a, a);
28705 return __Pyx_c_prod_float(
z,
z);
28711 }
else if (b.imag == 0) {
28712 z.real = powf(a.real, b.real);
28715 }
else if (a.real > 0) {
28720 theta = atan2f(0.0, -1.0);
28723 r = __Pyx_c_abs_float(a);
28724 theta = atan2f(a.imag, a.real);
28727 z_r = expf(lnr * b.real - theta * b.imag);
28728 z_theta = theta * b.real + lnr * b.imag;
28729 z.real = z_r * cosf(z_theta);
28730 z.imag = z_r * sinf(z_theta);
28737 #if CYTHON_CCOMPLEX
28739 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28740 return ::std::complex< double >(x, y);
28743 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28744 return x + y*(__pyx_t_double_complex)_Complex_I;
28748 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28749 __pyx_t_double_complex
z;
28757 #if CYTHON_CCOMPLEX
28759 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28760 return (a.real == b.real) && (a.imag == b.imag);
28762 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28763 __pyx_t_double_complex
z;
28764 z.real = a.real + b.real;
28765 z.imag = a.imag + b.imag;
28768 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28769 __pyx_t_double_complex
z;
28770 z.real = a.real - b.real;
28771 z.imag = a.imag - b.imag;
28774 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28775 __pyx_t_double_complex
z;
28776 z.real = a.real * b.real - a.imag * b.imag;
28777 z.imag = a.real * b.imag + a.imag * b.real;
28781 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28783 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28784 }
else if (fabs(b.real) >= fabs(b.imag)) {
28785 if (b.real == 0 && b.imag == 0) {
28786 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28788 double r = b.imag / b.real;
28789 double s = (double)(1.0) / (b.real + b.imag *
r);
28790 return __pyx_t_double_complex_from_parts(
28791 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28794 double r = b.real / b.imag;
28795 double s = (double)(1.0) / (b.imag + b.real *
r);
28796 return __pyx_t_double_complex_from_parts(
28797 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28801 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28803 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28805 double denom = b.real * b.real + b.imag * b.imag;
28806 return __pyx_t_double_complex_from_parts(
28807 (a.real * b.real + a.imag * b.imag) / denom,
28808 (a.imag * b.real - a.real * b.imag) / denom);
28812 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28813 __pyx_t_double_complex
z;
28818 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28819 return (a.real == 0) && (a.imag == 0);
28821 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28822 __pyx_t_double_complex
z;
28828 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
28829 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28830 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
28832 return hypot(
z.real,
z.imag);
28835 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28836 __pyx_t_double_complex
z;
28837 double r, lnr, theta, z_r, z_theta;
28838 if (b.imag == 0 && b.real == (
int)b.real) {
28840 double denom = a.real * a.real + a.imag * a.imag;
28841 a.real = a.real / denom;
28842 a.imag = -a.imag / denom;
28845 switch ((
int)b.real) {
28853 return __Pyx_c_prod_double(a, a);
28855 z = __Pyx_c_prod_double(a, a);
28856 return __Pyx_c_prod_double(
z, a);
28858 z = __Pyx_c_prod_double(a, a);
28859 return __Pyx_c_prod_double(
z,
z);
28865 }
else if (b.imag == 0) {
28866 z.real = pow(a.real, b.real);
28869 }
else if (a.real > 0) {
28874 theta = atan2(0.0, -1.0);
28877 r = __Pyx_c_abs_double(a);
28878 theta = atan2(a.imag, a.real);
28881 z_r = exp(lnr * b.real - theta * b.imag);
28882 z_theta = theta * b.real + lnr * b.imag;
28883 z.real = z_r * cos(z_theta);
28884 z.imag = z_r * sin(z_theta);
28891 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
28892 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
28893 const int is_unsigned = neg_one > const_zero;
28895 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
28896 return PyInt_FromLong((
long) value);
28897 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
28898 return PyLong_FromUnsignedLong((
unsigned long) value);
28899 #ifdef HAVE_LONG_LONG
28900 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
28901 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28905 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
28906 return PyInt_FromLong((
long) value);
28907 #ifdef HAVE_LONG_LONG
28908 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
28909 return PyLong_FromLongLong((PY_LONG_LONG) value);
28914 int one = 1;
int little = (int)*(
unsigned char *)&one;
28915 unsigned char *bytes = (
unsigned char *)&value;
28916 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
28917 little, !is_unsigned);
28922 static __Pyx_memviewslice
28923 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
28924 const char *mode,
int ndim,
28925 size_t sizeof_dtype,
int contig_flag,
28926 int dtype_is_object)
28928 __Pyx_RefNannyDeclarations
28930 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28931 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28932 Py_buffer *buf = &from_memview->view;
28933 PyObject *shape_tuple = NULL;
28934 PyObject *temp_int = NULL;
28935 struct __pyx_array_obj *array_obj = NULL;
28936 struct __pyx_memoryview_obj *memview_obj = NULL;
28937 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
28938 for (i = 0; i < ndim; i++) {
28939 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28940 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
28941 "indirect dimensions (axis %d)", i);
28945 shape_tuple = PyTuple_New(ndim);
28946 if (unlikely(!shape_tuple)) {
28949 __Pyx_GOTREF(shape_tuple);
28950 for(i = 0; i < ndim; i++) {
28951 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28952 if(unlikely(!temp_int)) {
28955 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28959 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28960 if (unlikely(!array_obj)) {
28963 __Pyx_GOTREF(array_obj);
28964 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28965 (PyObject *) array_obj, contig_flag,
28967 from_mvs->memview->typeinfo);
28968 if (unlikely(!memview_obj))
28970 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28972 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28973 dtype_is_object) < 0))
28977 __Pyx_XDECREF(new_mvs.memview);
28978 new_mvs.memview = NULL;
28979 new_mvs.data = NULL;
28981 __Pyx_XDECREF(shape_tuple);
28982 __Pyx_XDECREF(temp_int);
28983 __Pyx_XDECREF(array_obj);
28984 __Pyx_RefNannyFinishContext();
28989 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28990 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
28991 const int is_unsigned = neg_one > const_zero;
28992 #if PY_MAJOR_VERSION < 3
28993 if (likely(PyInt_Check(x))) {
28994 if (
sizeof(
int) <
sizeof(long)) {
28995 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28997 long val = PyInt_AS_LONG(x);
28998 if (is_unsigned && unlikely(val < 0)) {
28999 goto raise_neg_overflow;
29005 if (likely(PyLong_Check(x))) {
29007 #if CYTHON_USE_PYLONG_INTERNALS
29008 const digit* digits = ((PyLongObject*)x)->ob_digit;
29009 switch (Py_SIZE(x)) {
29010 case 0:
return (
int) 0;
29011 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
29013 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
29014 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29015 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29016 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
29017 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
29022 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
29023 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29024 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29025 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
29026 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29031 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
29032 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29033 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29034 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
29035 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
29041 #if CYTHON_COMPILING_IN_CPYTHON
29042 if (unlikely(Py_SIZE(x) < 0)) {
29043 goto raise_neg_overflow;
29047 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29048 if (unlikely(result < 0))
29050 if (unlikely(result == 1))
29051 goto raise_neg_overflow;
29054 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
29055 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
29056 #ifdef HAVE_LONG_LONG
29057 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
29058 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29062 #if CYTHON_USE_PYLONG_INTERNALS
29063 const digit* digits = ((PyLongObject*)x)->ob_digit;
29064 switch (Py_SIZE(x)) {
29065 case 0:
return (
int) 0;
29066 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
29067 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
29069 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
29070 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29071 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29072 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
29073 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29078 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
29079 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29080 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29081 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
29082 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29087 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
29088 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29089 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29090 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
29091 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29096 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
29097 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29098 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29099 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
29100 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29105 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
29106 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29107 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29108 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
29109 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29114 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
29115 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29116 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29117 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
29118 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29124 if (
sizeof(
int) <=
sizeof(long)) {
29125 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
29126 #ifdef HAVE_LONG_LONG
29127 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
29128 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
29133 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29134 PyErr_SetString(PyExc_RuntimeError,
29135 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29138 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29139 #if PY_MAJOR_VERSION < 3
29140 if (likely(
v) && !PyLong_Check(
v)) {
29142 v = PyNumber_Long(tmp);
29147 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29148 unsigned char *bytes = (
unsigned char *)&val;
29149 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29150 bytes,
sizeof(val),
29151 is_little, !is_unsigned);
29161 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29162 if (!tmp)
return (
int) -1;
29163 val = __Pyx_PyInt_As_int(tmp);
29168 PyErr_SetString(PyExc_OverflowError,
29169 "value too large to convert to int");
29171 raise_neg_overflow:
29172 PyErr_SetString(PyExc_OverflowError,
29173 "can't convert negative value to int");
29178 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
29179 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
29180 const int is_unsigned = neg_one > const_zero;
29181 #if PY_MAJOR_VERSION < 3
29182 if (likely(PyInt_Check(x))) {
29183 if (
sizeof(
long) <
sizeof(long)) {
29184 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
29186 long val = PyInt_AS_LONG(x);
29187 if (is_unsigned && unlikely(val < 0)) {
29188 goto raise_neg_overflow;
29194 if (likely(PyLong_Check(x))) {
29196 #if CYTHON_USE_PYLONG_INTERNALS
29197 const digit* digits = ((PyLongObject*)x)->ob_digit;
29198 switch (Py_SIZE(x)) {
29199 case 0:
return (
long) 0;
29200 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
29202 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
29203 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29204 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29205 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
29206 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
29211 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
29212 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29213 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29214 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
29215 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29220 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
29221 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29222 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29223 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
29224 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
29230 #if CYTHON_COMPILING_IN_CPYTHON
29231 if (unlikely(Py_SIZE(x) < 0)) {
29232 goto raise_neg_overflow;
29236 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29237 if (unlikely(result < 0))
29239 if (unlikely(result == 1))
29240 goto raise_neg_overflow;
29243 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
29244 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
29245 #ifdef HAVE_LONG_LONG
29246 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
29247 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29251 #if CYTHON_USE_PYLONG_INTERNALS
29252 const digit* digits = ((PyLongObject*)x)->ob_digit;
29253 switch (Py_SIZE(x)) {
29254 case 0:
return (
long) 0;
29255 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
29256 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
29258 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
29259 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29260 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29261 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29262 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29267 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
29268 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29269 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29270 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29271 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29276 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29277 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29278 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29279 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29280 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29285 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
29286 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29287 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29288 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29289 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29294 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29295 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29296 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29297 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
29298 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29303 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
29304 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29305 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29306 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
29307 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29313 if (
sizeof(
long) <=
sizeof(long)) {
29314 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
29315 #ifdef HAVE_LONG_LONG
29316 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
29317 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
29322 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29323 PyErr_SetString(PyExc_RuntimeError,
29324 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29327 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29328 #if PY_MAJOR_VERSION < 3
29329 if (likely(
v) && !PyLong_Check(
v)) {
29331 v = PyNumber_Long(tmp);
29336 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29337 unsigned char *bytes = (
unsigned char *)&val;
29338 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29339 bytes,
sizeof(val),
29340 is_little, !is_unsigned);
29350 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29351 if (!tmp)
return (
long) -1;
29352 val = __Pyx_PyInt_As_long(tmp);
29357 PyErr_SetString(PyExc_OverflowError,
29358 "value too large to convert to long");
29360 raise_neg_overflow:
29361 PyErr_SetString(PyExc_OverflowError,
29362 "can't convert negative value to long");
29367 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
29368 const char neg_one = (char) ((
char) 0 - (char) 1), const_zero = (char) 0;
29369 const int is_unsigned = neg_one > const_zero;
29370 #if PY_MAJOR_VERSION < 3
29371 if (likely(PyInt_Check(x))) {
29372 if (
sizeof(
char) <
sizeof(long)) {
29373 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
29375 long val = PyInt_AS_LONG(x);
29376 if (is_unsigned && unlikely(val < 0)) {
29377 goto raise_neg_overflow;
29383 if (likely(PyLong_Check(x))) {
29385 #if CYTHON_USE_PYLONG_INTERNALS
29386 const digit* digits = ((PyLongObject*)x)->ob_digit;
29387 switch (Py_SIZE(x)) {
29388 case 0:
return (
char) 0;
29389 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
29391 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
29392 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29393 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29394 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
29395 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
29400 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
29401 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29402 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29403 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
29404 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29409 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
29410 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29411 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29412 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
29413 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
29419 #if CYTHON_COMPILING_IN_CPYTHON
29420 if (unlikely(Py_SIZE(x) < 0)) {
29421 goto raise_neg_overflow;
29425 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29426 if (unlikely(result < 0))
29428 if (unlikely(result == 1))
29429 goto raise_neg_overflow;
29432 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
29433 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
29434 #ifdef HAVE_LONG_LONG
29435 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
29436 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29440 #if CYTHON_USE_PYLONG_INTERNALS
29441 const digit* digits = ((PyLongObject*)x)->ob_digit;
29442 switch (Py_SIZE(x)) {
29443 case 0:
return (
char) 0;
29444 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
29445 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
29447 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
29448 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29449 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29450 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29451 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29456 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
29457 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29458 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29459 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29460 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29465 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29466 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29467 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29468 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29469 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29474 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
29475 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29476 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29477 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29478 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29483 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29484 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29485 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29486 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
29487 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29492 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
29493 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29494 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29495 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
29496 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29502 if (
sizeof(
char) <=
sizeof(long)) {
29503 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
29504 #ifdef HAVE_LONG_LONG
29505 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
29506 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
29511 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29512 PyErr_SetString(PyExc_RuntimeError,
29513 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29516 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29517 #if PY_MAJOR_VERSION < 3
29518 if (likely(
v) && !PyLong_Check(
v)) {
29520 v = PyNumber_Long(tmp);
29525 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29526 unsigned char *bytes = (
unsigned char *)&val;
29527 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29528 bytes,
sizeof(val),
29529 is_little, !is_unsigned);
29539 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29540 if (!tmp)
return (
char) -1;
29541 val = __Pyx_PyInt_As_char(tmp);
29546 PyErr_SetString(PyExc_OverflowError,
29547 "value too large to convert to char");
29549 raise_neg_overflow:
29550 PyErr_SetString(PyExc_OverflowError,
29551 "can't convert negative value to char");
29556 static int __Pyx_check_binary_version(
void) {
29557 char ctversion[4], rtversion[4];
29558 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29559 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
29560 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29562 PyOS_snprintf(message,
sizeof(message),
29563 "compiletime version %s of module '%.100s' "
29564 "does not match runtime version %s",
29565 ctversion, __Pyx_MODULE_NAME, rtversion);
29566 return PyErr_WarnEx(NULL, message, 1);
29572 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29574 #if PY_MAJOR_VERSION < 3
29575 if (t->is_unicode) {
29576 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29577 }
else if (t->intern) {
29578 *t->p = PyString_InternFromString(t->s);
29580 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29583 if (t->is_unicode | t->is_str) {
29585 *t->p = PyUnicode_InternFromString(t->s);
29586 }
else if (t->encoding) {
29587 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29589 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29592 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29597 if (PyObject_Hash(*t->p) == -1)
29604 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29605 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29607 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29609 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29611 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29612 #if !CYTHON_PEP393_ENABLED
29613 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29615 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29616 if (!defenc)
return NULL;
29617 defenc_c = PyBytes_AS_STRING(defenc);
29618 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29620 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29622 for (
c = defenc_c;
c < end;
c++) {
29623 if ((
unsigned char) (*
c) >= 128) {
29624 PyUnicode_AsASCIIString(o);
29630 *length = PyBytes_GET_SIZE(defenc);
29634 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29635 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29636 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29637 if (likely(PyUnicode_IS_ASCII(o))) {
29638 *length = PyUnicode_GET_LENGTH(o);
29639 return PyUnicode_AsUTF8(o);
29641 PyUnicode_AsASCIIString(o);
29645 return PyUnicode_AsUTF8AndSize(o, length);
29650 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29651 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29653 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29654 __Pyx_sys_getdefaultencoding_not_ascii &&
29656 PyUnicode_Check(o)) {
29657 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29660 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29661 if (PyByteArray_Check(o)) {
29662 *length = PyByteArray_GET_SIZE(o);
29663 return PyByteArray_AS_STRING(o);
29668 int r = PyBytes_AsStringAndSize(o, &result, length);
29669 if (unlikely(
r < 0)) {
29676 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29677 int is_true = x == Py_True;
29678 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29679 else return PyObject_IsTrue(x);
29681 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29683 if (unlikely(!x))
return -1;
29684 retval = __Pyx_PyObject_IsTrue(x);
29688 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29689 #if PY_MAJOR_VERSION >= 3
29690 if (PyLong_Check(result)) {
29691 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29692 "__int__ returned non-int (type %.200s). "
29693 "The ability to return an instance of a strict subclass of int "
29694 "is deprecated, and may be removed in a future version of Python.",
29695 Py_TYPE(result)->tp_name)) {
29702 PyErr_Format(PyExc_TypeError,
29703 "__%.4s__ returned non-%.4s (type %.200s)",
29704 type_name, type_name, Py_TYPE(result)->tp_name);
29708 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29709 #if CYTHON_USE_TYPE_SLOTS
29710 PyNumberMethods *m;
29712 const char *name = NULL;
29713 PyObject *res = NULL;
29714 #if PY_MAJOR_VERSION < 3
29715 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29717 if (likely(PyLong_Check(x)))
29719 return __Pyx_NewRef(x);
29720 #if CYTHON_USE_TYPE_SLOTS
29721 m = Py_TYPE(x)->tp_as_number;
29722 #if PY_MAJOR_VERSION < 3
29723 if (m && m->nb_int) {
29725 res = m->nb_int(x);
29727 else if (m && m->nb_long) {
29729 res = m->nb_long(x);
29732 if (likely(m && m->nb_int)) {
29734 res = m->nb_int(x);
29738 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29739 res = PyNumber_Int(x);
29743 #if PY_MAJOR_VERSION < 3
29744 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29746 if (unlikely(!PyLong_CheckExact(res))) {
29748 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29751 else if (!PyErr_Occurred()) {
29752 PyErr_SetString(PyExc_TypeError,
29753 "an integer is required");
29757 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29760 #if PY_MAJOR_VERSION < 3
29761 if (likely(PyInt_CheckExact(b))) {
29762 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29763 return PyInt_AS_LONG(b);
29765 return PyInt_AsSsize_t(b);
29768 if (likely(PyLong_CheckExact(b))) {
29769 #if CYTHON_USE_PYLONG_INTERNALS
29770 const digit* digits = ((PyLongObject*)b)->ob_digit;
29771 const Py_ssize_t size = Py_SIZE(b);
29772 if (likely(__Pyx_sst_abs(size) <= 1)) {
29773 ival = likely(size) ? digits[0] : 0;
29774 if (size == -1) ival = -ival;
29779 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29780 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29784 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29785 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29789 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29790 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29794 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29795 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29799 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29800 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29804 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29805 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29811 return PyLong_AsSsize_t(b);
29813 x = PyNumber_Index(b);
29815 ival = PyInt_AsSsize_t(x);
29819 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29820 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29822 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29823 return PyInt_FromSize_t(ival);